public void SelectWater()
 {
     waterTankBG.color      = Color.white;
     gelTankBG.color        = Color.black;
     superFluidTankBG.color = Color.black;
     fluidType = FluidType.Water;
 }
 public void SelectGel()
 {
     waterTankBG.color      = Color.black;
     gelTankBG.color        = Color.white;
     superFluidTankBG.color = Color.black;
     fluidType = FluidType.Gel;
 }
 public void SelectSuperFluid()
 {
     waterTankBG.color      = Color.black;
     gelTankBG.color        = Color.black;
     superFluidTankBG.color = Color.white;
     fluidType = FluidType.SuperFluid;
 }
예제 #4
0
파일: World.cs 프로젝트: Genae/VoxelEngine
        private void Gravity(Vector3Int worldPos, World world, FluidType fluidBelow, Vector3Int below)
        {
            var transfer = (ushort)Mathf.Min(8 - fluidBelow.Height, Height);

            Height = (ushort)(Height - transfer);
            world.SetVoxel(Mat, worldPos, Height);
            world.SetVoxel(Mat, below, (ushort)(fluidBelow.Height + transfer));
        }
    // Start is called before the first frame update
    void Start()
    {
        fluidType = FluidType.Water;

        waterTankBG.color      = Color.white;
        gelTankBG.color        = Color.black;
        superFluidTankBG.color = Color.black;

        inputManager.RegisterAction(InputManager.Keys.actionbar1, SelectWater, GetInstanceID());
        inputManager.RegisterAction(InputManager.Keys.actionbar2, SelectGel, GetInstanceID());
        inputManager.RegisterAction(InputManager.Keys.actionbar3, SelectSuperFluid, GetInstanceID());
    }
예제 #6
0
    public AlienLetter GetLetter(FluidType fluid, List <AlienLetter> variants)
    {
        foreach (var variant in variants)
        {
            if (variant.Fluid == fluid)
            {
                return(variant);
            }
        }

        foreach (var letter in CanonicalLetters)
        {
            if (letter.Fluid == fluid)
            {
                return(letter);
            }
        }

        return(null);
    }
예제 #7
0
    // Start is called before the first frame update
    void Awake()
    {
        lifeTime      = 0f;
        fluidSelector = FindObjectOfType <FluidSelector>();
        fluidType     = fluidSelector.fluidType;

        switch (fluidType)
        {
        case FluidType.Water:
            GetComponent <Renderer>().material = waterMaterial;
            break;

        case FluidType.Gel:
            GetComponent <Renderer>().material = gelMaterial;
            break;

        case FluidType.SuperFluid:
            GetComponent <Renderer>().material = superFluidMaterial;
            break;
        }
    }
예제 #8
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Projectile")
        {
            if (fluid == FluidType.None)
            {
                fluid = other.GetComponent <Projectile>().fluidType;

                switch (fluid)
                {
                case FluidType.Water:
                    GetComponent <Renderer>().material = waterMaterial;
                    break;

                case FluidType.Gel:
                    GetComponent <Renderer>().material = gelMaterial;
                    break;

                case FluidType.SuperFluid:
                    GetComponent <Renderer>().material = superFluidMaterial;
                    break;
                }
            }
            if (other.GetComponent <Projectile>().fluidType == fluid)
            {
                collider.center = transform.InverseTransformPoint(new Vector3(other.transform.position.x, 0f, other.transform.position.z));
                Destroy(other.gameObject);
                if (targetHeight.y < heightLimit)
                {
                    targetHeight += new Vector3(0f, 0.1f, 0f);
                    timer         = 0.05f;
                }
            }
        }
        if (other.gameObject.tag == "PlayerTrigger")
        {
            gamestateManager.dead = true;
        }
    }
예제 #9
0
        /// <summary>
        /// Gets the color a particular pixel should be drawn with.
        /// </summary>
        /// <param name="fluidType">The type of terrain.</param>
        /// <param name="localX">The patch local X coordinate.</param>
        /// <param name="localY">The patch local Y coordinate.</param>
        /// <param name="textured">Whether to return color for a textured render.</param>
        /// <returns>See summary.</returns>
        private static Color GetDrawColor(FluidType fluidType, int localX, int localY, bool textured)
        {
            if (textured)
            {
                Bitmap texture = fluidType.GetImage();
                Xna.Point texCoords = WorldMap.GetPixels(new Vector2(localX / (float)TerrainPatch.PatchSize, localY / (float)TerrainPatch.PatchSize), texture);
                Color sysColor = texture.GetPixel(texCoords.X, texCoords.Y);
                Xna.Graphics.Color drawColor = new Microsoft.Xna.Framework.Graphics.Color(sysColor.R, sysColor.G, sysColor.B, sysColor.A);

                return TextureManipulation.XnaColorToSystemColor(drawColor);
            }
            else
            {
                return TextureManipulation.XnaColorToSystemColor(fluidType.GetWorldMapColor());
            }
        }
예제 #10
0
        private void Stream(ArrayList data, FluidType fluidType)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(FluidType)));

             // Nothing at this level yet
        }
예제 #11
0
        Stream(ArrayList data, FluidType fluidType)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(FluidType)));

            // Nothing at this level yet
        }
예제 #12
0
        Stream(ArrayList data, ElementType sym)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(ElementType)));

            // no data at this level yet

            AnnotationSymbolType annoType = sym as AnnotationSymbolType;

            if (annoType != null)
            {
                Stream(data, annoType);
                return;
            }

            AreaReinforcementType areaReinforcementType = sym as AreaReinforcementType;

            if (areaReinforcementType != null)
            {
                Stream(data, areaReinforcementType);
                return;
            }

            AreaTagType areaTagType = sym as AreaTagType;

            if (areaTagType != null)
            {
                Stream(data, areaTagType);
                return;
            }

            BeamSystemType beamSystemType = sym as BeamSystemType;

            if (beamSystemType != null)
            {
                Stream(data, beamSystemType);
                return;
            }

            DimensionType dimType = sym as DimensionType;

            if (dimType != null)
            {
                Stream(data, dimType);
                return;
            }

            //TF
            FabricSheetType fabricST = sym as FabricSheetType;

            if (fabricST != null)
            {
                Stream(data, fabricST);
                return;
            }

            FabricWireType fabricWT = sym as FabricWireType;

            if (fabricWT != null)
            {
                Stream(data, fabricWT);
                return;
            }
            //TFEND

            GroupType groupType = sym as GroupType;

            if (groupType != null)
            {
                Stream(data, groupType);
                return;
            }

            HostObjAttributes hostAtt = sym as HostObjAttributes;

            if (hostAtt != null)
            {
                Stream(data, hostAtt);
                return;
            }

            InsertableObject insObj = sym as InsertableObject;

            if (insObj != null)
            {
                Stream(data, insObj);
                return;
            }

            LevelType levelType = sym as LevelType;

            if (levelType != null)
            {
                Stream(data, levelType);
                return;
            }

            LineAndTextAttrSymbol lineAndTextAttr = sym as LineAndTextAttrSymbol;

            if (lineAndTextAttr != null)
            {
                Stream(data, lineAndTextAttr);
                return;
            }

            LoadTypeBase loadTypeBase = sym as LoadTypeBase;

            if (loadTypeBase != null)
            {
                Stream(data, loadTypeBase);
                return;
            }

            MEPBuildingConstruction mepBldConst = sym as MEPBuildingConstruction;

            if (mepBldConst != null)
            {
                Stream(data, mepBldConst);
                return;
            }

            PathReinforcementType pathReinforcementType = sym as PathReinforcementType;

            if (pathReinforcementType != null)
            {
                Stream(data, pathReinforcementType);
                return;
            }

            RebarBarType rebarBarType = sym as RebarBarType;

            if (rebarBarType != null)
            {
                Stream(data, rebarBarType);
                return;
            }

            RebarCoverType rebarCoverType = sym as RebarCoverType;

            if (rebarCoverType != null)
            {
                Stream(data, rebarCoverType);
                return;
            }

            RebarHookType rebarHookType = sym as RebarHookType;

            if (rebarHookType != null)
            {
                Stream(data, rebarHookType);
                return;
            }

            RebarShape rebarShape = sym as RebarShape;

            if (rebarShape != null)
            {
                Stream(data, rebarShape);
                return;
            }

            RoomTagType roomTagType = sym as RoomTagType;

            if (roomTagType != null)
            {
                Stream(data, roomTagType);
                return;
            }

            SpaceTagType spaceTagType = sym as SpaceTagType;

            if (spaceTagType != null)
            {
                Stream(data, spaceTagType);
                return;
            }

            TrussType trussType = sym as TrussType;

            if (trussType != null)
            {
                Stream(data, trussType);
                return;
            }

            DistributionSysType distSysType = sym as DistributionSysType;

            if (distSysType != null)
            {
                Stream(data, distSysType);
                return;
            }

            MEPCurveType mepCurType = sym as MEPCurveType;

            if (mepCurType != null)
            {
                Stream(data, mepCurType);
                return;
            }

            FluidType fluidType = sym as FluidType;

            if (fluidType != null)
            {
                Stream(data, fluidType);
                return;
            }

            PipeScheduleType pipeSchedType = sym as PipeScheduleType;

            if (pipeSchedType != null)
            {
                Stream(data, pipeSchedType);
                return;
            }

            VoltageType voltType = sym as VoltageType;

            if (voltType != null)
            {
                Stream(data, voltType);
                return;
            }

            WireType wireType = sym as WireType;

            if (wireType != null)
            {
                Stream(data, wireType);
                return;
            }

            ModelTextType modelTxtType = sym as ModelTextType;

            if (modelTxtType != null)
            {
                Stream(data, modelTxtType);
                return;
            }
        }
예제 #13
0
파일: PPipe.cs 프로젝트: ycruan/P58_Loss
            public static bool Recognization(Pipe pipe)
            {
                _pipe = pipe;
                try
                {
                    _diameter = pipe.Diameter * 12;
                }
                catch
                {
                    _abandonWriter.WriteAbandonment(pipe, AbandonmentTable.Pipe_NonCircular);
                    return(false);
                }
                _length = pipe.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble();
                _level  = _doc.GetElement(pipe.get_Parameter(BuiltInParameter.RBS_START_LEVEL_PARAM).AsElementId()) as Level;
                _offset = pipe.get_Parameter(BuiltInParameter.RBS_START_OFFSET_PARAM).AsDouble();
                bool isFound;

                _floor = _myLevel.GetFloor(out isFound, _level, _offset) - 1;
                if (_floor == MyLevel.GetLevelNum() || _floor < 0)
                {
                    _abandonWriter.WriteAbandonment(pipe, AbandonmentTable.LevelOutOfRoof);
                    return(false);
                }
                SDC sdc = _addiInfo.sdc;

                _material = ((Material)_doc.GetElement(pipe.get_Parameter(BuiltInParameter.RBS_PIPE_MATERIAL_PARAM).AsElementId())).MaterialCategory;
                _pipeType = PipeType.Unknown;
                try
                {
                    PipingSystem     pipingSys     = pipe.MEPSystem as PipingSystem;
                    PipingSystemType pipingSysType = _doc.GetElement(pipingSys.GetTypeId()) as PipingSystemType;
                    FluidType        fluidType     = _doc.GetElement(pipingSysType.FluidType) as FluidType;
                    String           pstName       = pipingSysType.Name;

                    if (pstName.Contains("冷水"))
                    {
                        _pipeType = PipeType.ColdWater;
                    }
                    if (pstName.Contains("热水"))
                    {
                        _pipeType = PipeType.HotWater;
                    }
                    if (pstName.Contains("卫生"))
                    {
                        _pipeType = PipeType.SanitaryWater;
                    }
                    if (pstName.Contains("冷却"))
                    {
                        _pipeType = PipeType.ChilledWater;
                    }
                    if (pstName.Contains("蒸汽"))
                    {
                        _pipeType = PipeType.Steam;
                    }
                    if (pstName.Contains("消防"))
                    {
                        _pipeType = PipeType.FireSprinkler;
                    }

                    if (_pipeType == PipeType.Unknown)
                    {
                        double temperature = pipingSysType.FluidTemperature - 273.15;
                        if (5 < temperature && temperature < 15)
                        {
                            _pipeType = PipeType.ColdWater;
                        }
                        else if (30 < temperature && temperature < 100)
                        {
                            _pipeType = PipeType.HotWater;
                        }
                        else if (temperature <= 5)
                        {
                            _pipeType = PipeType.ChilledWater;
                        }
                        else if (100 <= temperature)
                        {
                            _pipeType = PipeType.Steam;
                        }
                        else
                        {
                            _abandonWriter.WriteAbandonment(pipe, AbandonmentTable.Pipe_TypeUnknown);
                            return(false);
                        }
                    }
                }
                catch
                {
                    _abandonWriter.WriteAbandonment(pipe, AbandonmentTable.Pipe_TypeUnknown);
                    return(false);
                }
                if (_pipeType != PipeType.ColdWater && !IsValidMaterial(_material))
                {
                    _abandonWriter.WriteAbandonment(_pipe, AbandonmentTable.Pipe_MatlOOR);
                    return(false);
                }

                return(true);
            }
예제 #14
0
 public override void Load(TagCompound tag)
 {
     amount    = tag.GetInt("Amount");
     fluidType = (FluidType)tag.GetInt("Type");
 }
예제 #15
0
 private static void ReadLiquidTypes(BinaryReader reader, FluidType[,] types)
 {
     for (var y = 0; y < TerrainConstants.ChunksPerTileSide; y++)
     {
         for (var x = 0; x < TerrainConstants.ChunksPerTileSide; x++)
         {
             types[x, y] = (FluidType)reader.ReadByte();
         }
     }
 }
예제 #16
0
 public void Apply(FluidType fluid)
 {
     LastStep.Fluids.Add(fluid);
 }
예제 #17
0
		public static FluidType[,] ExtractTileLiquidTypes(ADTFile adt)
		{
			var types = new FluidType[TerrainConstants.ChunksPerTileSide, TerrainConstants.ChunksPerTileSide];
			for (var y = 0; y < TerrainConstants.ChunksPerTileSide; y++)
			{
				for (var x = 0; x < TerrainConstants.ChunksPerTileSide; x++)
				{
					if (adt.LiquidMaps[x, y] == null)
					{
						types[x, y] = FluidType.None;
						continue;
					}
					types[x, y] = adt.LiquidMaps[x, y].Type;
				}
			}
			return types;
		}
예제 #18
0
		public static FluidType[,] ReadLiquidTypes(BinaryReader reader)
		{
			var types = new FluidType[TerrainConstants.ChunksPerTileSide, TerrainConstants.ChunksPerTileSide];
			for (var y = 0; y < TerrainConstants.ChunksPerTileSide; y++)
			{
				for (var x = 0; x < TerrainConstants.ChunksPerTileSide; x++)
				{
					types[x, y] = (FluidType)reader.ReadByte();
				}
			}
			return types;
		}
예제 #19
0
 public Fluid(FluidType type, int amount)
 {
     this.Type   = type;
     this.Amount = amount;
 }
예제 #20
0
 public SexualOrganWithFluid(FluidType fluidType, int baseSize) : base(baseSize) => sexualFluid = new SexualFluid(fluidType, BaseSize);