// Event handling method for the "Fire" button public void FireButtonClicked(object source, EventArgs e) { // Get some initial quantities from the textfields. double flameTemp = Convert.ToDouble(flameTempTextBox.Text); double thickness = Convert.ToDouble(thicknessTextBox.Text); // Set the initial temperature. double initialT = 300.0; // Set the diffusivity according to the material selected. double diffusivity; String material = (string)materialComboBox.SelectedItem; if (String.Equals(material, "Aluminum")) { diffusivity = 9.975e-5; } else { diffusivity = 6.6e-7; // concrete } // Create a GasTank object. tank = new GasTank(thickness, diffusivity, initialT, flameTemp); // Set the display for the outer wall temperature textfield outerTempTextBox.Text = "" + flameTemp; // Update the display UpdateDisplay(); // Fire the flamethrower using a Timer object gameTimer.Start(); }
public void GasTankLCTest() { Logging.LogService.SetLogger(new DebugLogger()); // MockupGonnector Test var connector1 = new MockGasTankConnector(false, ValveState.Full, ValveState.Half); var gs1 = new GasTank("난방가스탱크", connector1); var connector2 = new MockGasTankConnector(true, ValveState.Closed, ValveState.Half); var gs2 = new GasTank("발전용가스탱크", connector2); // MockupGonnector Test //var connector1 = new SerialGasTankConnector(); //var gs1 = new GasTank("난방가스탱크", connector1); //var connector2 = new SerialGasTankConnector(); //var gs2 = new GasTank("발전용가스탱크", connector2); Assert.IsTrue(gs1.CheckConnection() == false); Assert.IsTrue(gs2.CheckConnection() == true); Assert.AreEqual(gs2.GetValveState(1), ValveState.Closed); Assert.AreEqual(gs2.GetValveState(2), ValveState.Half); gs2.SetValveState(1, ValveState.Half); gs2.SetValveState(2, ValveState.Closed); Assert.AreEqual(gs2.GetValveState(1), ValveState.Half); Assert.AreEqual(gs2.GetValveState(2), ValveState.Closed); }
private void addEnergySourceInformation(ref string i_RequestedMessage, Vehicle i_RequestedVehicle) { string tempRequestedMessage; if (i_RequestedVehicle.EnergySource is GasTank) { GasTank gasTank = (GasTank)i_RequestedVehicle.EnergySource; tempRequestedMessage = string.Format( @"{0} Current state of fuel is :{1} Energy left in percent :{2}% The type of fuel is: {3}", i_RequestedMessage, gasTank.CurrentAmountOfForce, gasTank.RemainingEnergyPercent, gasTank.TypeOfFuel); } else if (i_RequestedVehicle.EnergySource is Battery) { Battery battery = (Battery)i_RequestedVehicle.EnergySource; tempRequestedMessage = string.Format( @"{0} Remaining time for battery : {1} hours Energy left in percent: {2}%", i_RequestedMessage, battery.CurrentAmountOfForce, battery.RemainingEnergyPercent); } else { throw new ArgumentException(); } i_RequestedMessage = tempRequestedMessage; }
public Program() { _oxygenTanks = new List <GasTank>(); _hydrogenTanks = new List <GasTank>(); List <IMyGasTank> _allTanks = new List <IMyGasTank>(); GridTerminalSystem.GetBlocksOfType(_allTanks); foreach (var tank in _allTanks) { GasTank gasTank = new GasTank(tank); if (gasTank.MyGasType == GasType.Hydrogen) { _hydrogenTanks.Add(gasTank); } else { _oxygenTanks.Add(gasTank); } } Print("Oxygen Tanks: " + _oxygenTanks.Count); Print("Hydrogen Tanks: " + _hydrogenTanks.Count); _debugScreen = GridTerminalSystem.GetBlockWithName(LCDSCREEN) as IMyTextPanel; if (_debugScreen != null) { _debugScreen.ContentType = ContentType.TEXT_AND_IMAGE; } }
public void GasTank_ConnectionTest() { GS1 = new GasTank("난방가스탱크", "192.168.0.22:777"); GS2 = new GasTank("비상발전가스탱크", "192.168.0.23:777"); var result1 = GS1.CheckConnection(); Assert.IsTrue(result1); var result2 = GS2.CheckConnection(); Assert.IsTrue(result2); }
void MakeInstance() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void ShowTank(GasTank tank) { string gasName = tank.transform.parent.name; gasName = gasName.Split(' ')[0]; GUILayout.BeginHorizontal(); GUILayout.Label(gasName, GUILayout.MinWidth(40f)); tank.gasWeight = EditorGUILayout.Slider(tank.gasWeight, 0f, tank.maxGasWeight, GUILayout.MinWidth(3f)); GUILayout.Label("Max weight", GUILayout.MinWidth(70f)); tank.maxGasWeight = EditorGUILayout.FloatField(tank.maxGasWeight, GUILayout.MaxWidth(40f)); GUILayout.EndHorizontal(); }
void Start() { // inicializacia autovych premenych this.breaking = false; this.velocity = 0.0f; this.firstPoweredWheel = -1; this.tank = new GasTank(gasTankCapacity, defaultGasTankValue); this.direction = 0f; this.wheelsCollisionAny = false; this.carCollisionAny = false; this.leaningDirectionLast = 0; this.leaningDirection = 0; this.leaningValue = 0; this.finish = false; InitializeAllWheels(); }
private static VehicleCardInGarage getFromUserInfoAboutTruckAndMakeAVehicleCard(Owner i_Owner, string i_Model, string i_LicenceNumber) { int userChoice; float baggageVolume; bool isThereDangerousMetials; GasTank gasTank = getFromUserGasTankInfo(Truck.k_GasType, Truck.k_MaximalTankSize); Wheel[] wheels = getFromUserVehicleWheels(Truck.k_NumOfWheels, Truck.k_MaximalAirPressure); Vehicle vehicle; Console.WriteLine("What is the truck's baggage volume?"); baggageVolume = getFromUserUnNegativeFloatLessThanMax(float.MaxValue); Console.WriteLine("Is there an dangerous metirials?\n1.YES\n2.NO"); userChoice = getFromUerNumberInARange(1, 2); isThereDangerousMetials = userChoice == 1; vehicle = VehicleMaker.TruckMaker(i_Owner, i_Model, i_LicenceNumber, gasTank, wheels, isThereDangerousMetials, baggageVolume); return(new VehicleCardInGarage(vehicle)); }
private void fillEnergySource() { string licensePlate; GasTank.eFuelType fuelOptions = new GasTank.eFuelType(); string PartOfOptionsHeaderMsg = string.Format("fuel type"); GasTank.eFuelType fuelType; UI.GetVehicleLicensePlate(m_Garage, out licensePlate); GasTank gasTank = m_Garage.ServiceDetailsList[licensePlate].Vehicle.EnergySource as GasTank; if (gasTank != null) { fuelType = (GasTank.eFuelType)UI.GetSpecificEnumInput(PartOfOptionsHeaderMsg, fuelOptions); gasTank.CheckFuelType(fuelType); } insertAmountOfEnergyToAdd(m_Garage.ServiceDetailsList[licensePlate].Vehicle); }
void Start() { airController = GetComponentInParent <CapsuleAirController>(); tank = GetComponentInChildren <GasTank>(); powerSocket = GetComponent <PowerSocket>(); }
public static Vehicle GasBikeMaker(Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, Bike.eLicenceType i_LicenceType, int i_EngineVolume) { return(new GasBike(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels, i_LicenceType, i_EngineVolume)); }
public static Vehicle GasCarMaker(Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, Car.eColor i_Color, Car.eNumberOfDoors i_NumberOfDoors) { return(new GasCar(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels, i_Color, i_NumberOfDoors)); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { Storage storage = go.AddComponent <Storage>(); storage.capacityKg = 20000f; go.AddOrGet <BuildingComplete>().isManuallyOperated = false; go.AddOrGet <LoopingSounds>(); Prioritizable.AddRef(go); //float num = 2426.72f; //float num2 = 0.01f; GasTank liquidCooledFan = go.AddOrGet <GasTank>(); //liquidCooledFan.gasStorage = storage; liquidCooledFan.gasStorage = storage; //liquidCooledFan.waterKGConsumedPerKJ = 1f / (num * num2); //liquidCooledFan.coolingKilowatts = 80f; //liquidCooledFan.minCooledTemperature = 290f; //liquidCooledFan.minEnvironmentMass = 0.25f; //liquidCooledFan.minCoolingRange = new Vector2I(-2, 0); //liquidCooledFan.maxCoolingRange = new Vector2I(2, 4); /* * ManualDeliveryKG manualDeliveryKG = go.AddComponent<ManualDeliveryKG>(); * manualDeliveryKG.requestedItemTag = new Tag("Water"); * manualDeliveryKG.capacity = 500f; * manualDeliveryKG.refillMass = 50f; * manualDeliveryKG.choreTypeIDHash = Db.Get().ChoreTypes.Fetch.IdHash; * * ElementConsumer elementConsumer = go.AddOrGet<ElementConsumer>(); * elementConsumer.storeOnConsume = true; * elementConsumer.storage = storage; * elementConsumer.configuration = ElementConsumer.Configuration.AllGas; * elementConsumer.consumptionRadius = 8; * elementConsumer.EnableConsumption(true); * elementConsumer.sampleCellOffset = new Vector3(0f, 0f); * elementConsumer.showDescriptor = false; */ ElementConsumer elementConsumer = go.AddOrGet <ElementConsumer>(); ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>(); conduitConsumer.conduitType = ConduitType.Gas; conduitConsumer.consumptionRate = 10f; //conduitConsumer.capacityKG = 20000f; conduitConsumer.capacityTag = GameTags.Gas; conduitConsumer.forceAlwaysSatisfied = true; conduitConsumer.alwaysConsume = true; conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.conduitType = ConduitType.Gas; /* * LiquidCooledFanWorkable liquidCooledFanWorkable = go.AddOrGet<LiquidCooledFanWorkable>(); * liquidCooledFanWorkable.SetWorkTime(20f); * liquidCooledFanWorkable.overrideAnims = new KAnimFile[1] * { * Assets.GetAnim("anim_interacts_liquidfan_kanim") * }; */ }
public GasBike( Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, eLicenceType i_LicenceType, int i_EngineVolume) : base(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels, i_LicenceType, i_EngineVolume) { }
public Truck(Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, bool i_IsThereDangerousMatirial, float i_BaggaeVolume) : base(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels) { m_BaggaeVolume = i_BaggaeVolume; m_IsThereDangerousMatirial = i_IsThereDangerousMatirial; }
public GasCar(Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, eColor i_Color, eNumberOfDoors i_NumberOfDoors) : base(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels, i_Color, i_NumberOfDoors) { }
public static Vehicle TruckMaker(Owner i_Owner, string i_Model, string i_LicenceNumber, GasTank i_GasTank, Wheel[] i_Wheels, bool i_IsThereDangerousMatirial, float i_BaggaeVolume) { return(new Truck(i_Owner, i_Model, i_LicenceNumber, i_GasTank, i_Wheels, i_IsThereDangerousMatirial, i_BaggaeVolume)); }