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; }
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()); }
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); }
// 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; } }
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; } }
/// <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()); } }
private void Stream(ArrayList data, FluidType fluidType) { data.Add(new Snoop.Data.ClassSeparator(typeof(FluidType))); // Nothing at this level yet }
Stream(ArrayList data, FluidType fluidType) { data.Add(new Snoop.Data.ClassSeparator(typeof(FluidType))); // Nothing at this level yet }
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; } }
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); }
public override void Load(TagCompound tag) { amount = tag.GetInt("Amount"); fluidType = (FluidType)tag.GetInt("Type"); }
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(); } } }
public void Apply(FluidType fluid) { LastStep.Fluids.Add(fluid); }
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; }
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; }
public Fluid(FluidType type, int amount) { this.Type = type; this.Amount = amount; }
public SexualOrganWithFluid(FluidType fluidType, int baseSize) : base(baseSize) => sexualFluid = new SexualFluid(fluidType, BaseSize);