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;
            }
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
0
 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 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()));
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 10
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;
 }
Ejemplo n.º 12
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;
 }
Ejemplo n.º 13
0
 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;
 }
Ejemplo n.º 14
0
 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";
 }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
 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;
 }
Ejemplo n.º 17
0
 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;
 }
Ejemplo n.º 18
0
 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;
 }
Ejemplo n.º 19
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;
 }
Ejemplo n.º 20
0
 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;
 }
Ejemplo n.º 21
0
 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;
 }
Ejemplo n.º 22
0
 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);
        }
Ejemplo n.º 24
0
 public AircraftRegistration(PoweredAircraft Aircraft, bool HasCrashed)
 {
     this.HasCrashed = HasCrashed;
     this.Aircraft   = Aircraft;
 }
 public AircraftRegistration(PoweredAircraft Aircraft, bool HasCrashed)
 {
     this.HasCrashed = HasCrashed;
     this.Aircraft = Aircraft;
 }
Ejemplo n.º 26
0
 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;
        }
Ejemplo n.º 32
0
 public void GetNotifiedAboutEngineChange(PoweredAircraft aircraft)
 {
     registeredEngines.RemoveAll(tuple => tuple.Item1 == aircraft.SerialNumber);
     registeredEngines.Add(new Tuple <string, List <Engine> >(aircraft.SerialNumber, aircraft.Engines.ToList()));
 }