public bool TryMakeTurbofan(float bypassratio, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> fueList, List<Oxidiser> oxidisers, string manuf, string model, string serialnumber, float maxpower, float operatingtime, float fuelflow, OnOff stat, out Turbofan incomingTurbofan, bool isgeared = false, bool hasreverse = true, PoweredAircraft parentvehicle = null) { try { Turbofan turbofan = MakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); incomingTurbofan = turbofan; return true; } catch (ArgumentNullException argumentNullException) { Console.WriteLine(argumentNullException.Message); incomingTurbofan = null; return false; } catch (ArgumentException argumentException) { Console.WriteLine(argumentException.Message); incomingTurbofan = null; return false; } catch (Exception e) { Console.WriteLine(e.Message); incomingTurbofan = null; return false; } }
public PistonEngine(int numberofpistons, float volume, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _numberOfPistons = numberofpistons; _volume = volume; _mixture = 0; }
public Ramjet(bool hassupersoniccombustion, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _hasSupersonicCombustion = hassupersoniccombustion; }
public void RegisterEngines(PoweredAircraft aircraft) { if (registeredAircraft.Count(entry => entry.Aircraft.SerialNumber == aircraft.SerialNumber) == 0) { RegisterAircraft(aircraft, aircraft.IsOperational); return; } registeredEngines.RemoveAll(tuple => tuple.Item1 == aircraft.SerialNumber); registeredEngines.Add(new Tuple<string, List<Engine>>(aircraft.SerialNumber, aircraft.Engines.ToList())); }
public RocketEngine(bool isreignitable, string nozzlebelltype, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _isReignitable = isreignitable; _nozzleBellType = nozzlebelltype; }
public Ramjet(bool hassupersoniccombustion, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _hasSupersonicCombustion = hassupersoniccombustion; }
public Turbojet(bool hasreverse, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat, string precoolant = null) : base(hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { Precoolant = precoolant ?? "none"; }
public SolidFuelRocketEngine(bool isreignitable, string nozzlebelltype, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(isreignitable, nozzlebelltype, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _maxPower = maxpower; _currentPower = 0; }
public void RegisterEngines(PoweredAircraft aircraft) { if (registeredAircraft.Count(entry => entry.Aircraft.SerialNumber == aircraft.SerialNumber) == 0) { RegisterAircraft(aircraft, aircraft.IsOperational); return; } registeredEngines.RemoveAll(tuple => tuple.Item1 == aircraft.SerialNumber); registeredEngines.Add(new Tuple <string, List <Engine> >(aircraft.SerialNumber, aircraft.Engines.ToList())); }
public SolidFuelRocketEngine(bool isreignitable, string nozzlebelltype, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(isreignitable, nozzlebelltype, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _maxPower = maxpower; _currentPower = 0; }
public Turboshaft(float gearingratio, float maxtorque, bool hasreverse, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _gearingRatio = gearingratio; _maxTorque = maxtorque; }
public Turbofan(float bypassratio, bool isgeared, bool hasreverse, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _bypassRatio = bypassratio; _isGeared = isgeared; }
public Turbojet(bool hasreverse, int numberofshafts, Generator gen, List <Spool> spools, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat, string precoolant = null) : base( hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { Precoolant = precoolant ?? "none"; }
public JetEngine(int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _egt = egt; _isp = isp; _numberOfCycles = numberofcycles; _propellants = propellants; _oxidisers = oxidisers; }
public RocketEngine(bool isreignitable, string nozzlebelltype, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _isReignitable = isreignitable; _nozzleBellType = nozzlebelltype; }
public JetEngine(int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base(manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _egt = egt; _isp = isp; _numberOfCycles = numberofcycles; _propellants = propellants; _oxidisers = oxidisers; }
public Turbofan(float bypassratio, bool isgeared, bool hasreverse, int numberofshafts, Generator gen, List <Spool> spools, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _bypassRatio = bypassratio; _isGeared = isgeared; }
public Turboshaft(float gearingratio, float maxtorque, bool hasreverse, int numberofshafts, Generator gen, List <Spool> spools, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _gearingRatio = gearingratio; _maxTorque = maxtorque; }
public Engine(string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) { _manufacturer = manufacturer; _model = model; _currentPower = 0; _maxPower = maxpower; _serialNumber = serialnumber; _operatingTime = operatingtime; _parentAircraft = parentaircraft; _fuelFlow = fuelflow; _onOffStatus = stat; }
public TurbineEngine(bool hasreverse, int numberofshafts, Generator gen, List <Spool> spools, int egt, int isp, int numberofcycles, List <Propellant> propellants, List <Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _hasReverse = hasreverse; _numberOfShafts = numberofshafts; //Spools = spools; _generator = gen; }
public TurbineEngine(bool hasreverse, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> propellants, List<Oxidiser> oxidisers, string manufacturer, string model, string serialnumber, float maxpower, float operatingtime, PoweredAircraft parentaircraft, float fuelflow, OnOff stat) : base( egt, isp, numberofcycles, propellants, oxidisers, manufacturer, model, serialnumber, maxpower, operatingtime, parentaircraft, fuelflow, stat) { _hasReverse = hasreverse; _numberOfShafts = numberofshafts; //Spools = spools; _generator = gen; }
public Turbofan MakeTurbofan(float bypassratio, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> fueList, List<Oxidiser> oxidisers, string manuf, string model, string serialnumber, float maxpower, float operatingtime, float fuelflow, OnOff stat, bool isgeared = false, bool hasreverse = true, PoweredAircraft parentvehicle = null) { //return new Turbofan(3, false, true, 3, new Dictionary<Generator, double>(new GeneratorComparer()), // new List<Spool>(), 600, 500, 5, new List<Propellants> { Propellants.Jet_A }, // new List<Oxidisers> { Oxidisers.GOX }, "Rolls-Royce", "RB-201", "100000008", 27000, 12, "88", 0, OnOff.Stopped); GeneralConditionsChecker(numberofshafts, spools, fueList, oxidisers, serialnumber); Debug.WriteLine("Creating a new turbofan ({0})", serialnumber); return new Turbofan(bypassratio, isgeared, hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, parentvehicle, fuelflow, stat); }
public AircraftRegistration(PoweredAircraft Aircraft, bool HasCrashed) { this.HasCrashed = HasCrashed; this.Aircraft = Aircraft; }
public void RegisterAircraft(PoweredAircraft aircraft, bool isOperational) { registeredAircraft.Add(new AircraftRegistration(aircraft, isOperational)); registeredEngines.Add(new Tuple <string, List <Engine> >(aircraft.SerialNumber, aircraft.Engines.ToList())); }
public Turboshaft MakeTurboshaft(float gearingR, float maxtorque, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> fueList, List<Oxidiser> oxidisers, string manuf, string model, string serialnumber, float maxpower, float operatingtime, float fuelflow, OnOff stat, bool hasreverse = true, PoweredAircraft parentvehicle = null) { GeneralConditionsChecker(numberofshafts, spools, fueList, oxidisers, serialnumber); if (maxtorque <= 0) throw new ArgumentException("No max torque data was provided", nameof(maxtorque)); return new Turboshaft(gearingR, maxtorque, hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, parentvehicle, fuelflow, stat); }
public void GetNotifiedAboutEngineChange(PoweredAircraft aircraft) { registeredEngines.RemoveAll(tuple => tuple.Item1 == aircraft.SerialNumber); registeredEngines.Add(new Tuple<string, List<Engine>>(aircraft.SerialNumber, aircraft.Engines.ToList())); }
public Turbojet MakeTurbojet(int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> fueList, List<Oxidiser> oxidisers, string manuf, string model, string serialnumber, float maxpower, float operatingtime, float fuelflow, OnOff stat, bool hasreverse = true, PoweredAircraft parentvehicle = null) { GeneralConditionsChecker(numberofshafts, spools, fueList, oxidisers, serialnumber); return new Turbojet(hasreverse, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, parentvehicle, fuelflow, stat); }
public void RegisterAircraft(PoweredAircraft aircraft, bool isOperational) { registeredAircraft.Add(new AircraftRegistration(aircraft, isOperational)); registeredEngines.Add(new Tuple<string, List<Engine>>(aircraft.SerialNumber, aircraft.Engines.ToList())); }
public Turbofan TryMakeTurbofan(float bypassratio, int numberofshafts, Generator gen, List<Spool> spools, int egt, int isp, int numberofcycles, List<Propellant> fueList, List<Oxidiser> oxidisers, string manuf, string model, string serialnumber, float maxpower, float operatingtime, float fuelflow, OnOff stat, bool isgeared = false, bool hasreverse = true, PoweredAircraft parentvehicle = null) { Turbofan turbofan = new Turbofan(); try { turbofan = MakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); } catch (ArgumentNullException argumentNullException) { Console.WriteLine(argumentNullException.Message); switch (argumentNullException.ParamName) { case nameof(spools): spools = new List<Spool>(); TryMakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); break; case nameof(serialnumber): serialnumber = "no serial number specified"; TryMakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); break; case nameof(fueList): fueList = new List<Propellant>(); TryMakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); break; case nameof(oxidisers): oxidisers = new List<Oxidiser>(); TryMakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); break; } } catch (ArgumentException argumentException) when (argumentException.ParamName == nameof(numberofshafts)) { Console.WriteLine(argumentException.Message); if (argumentException.ParamName == nameof(numberofshafts)) { numberofshafts = 1; TryMakeTurbofan(bypassratio, numberofshafts, gen, spools, egt, isp, numberofcycles, fueList, oxidisers, manuf, model, serialnumber, maxpower, operatingtime, fuelflow, stat, isgeared, hasreverse, parentvehicle); } } catch (Exception e) { Console.WriteLine(e.Message); } return turbofan; }
public void GetNotifiedAboutEngineChange(PoweredAircraft aircraft) { registeredEngines.RemoveAll(tuple => tuple.Item1 == aircraft.SerialNumber); registeredEngines.Add(new Tuple <string, List <Engine> >(aircraft.SerialNumber, aircraft.Engines.ToList())); }