public AirlinerPassengerType(Manufacturer manufacturer, string name,string family, int seating, int cockpitcrew, int cabincrew, double speed, long range, double wingspan, double length, double consumption, long price, int maxAirlinerClasses, long minRunwaylength, long fuelcapacity, BodyType body, TypeRange rangeType, EngineType engine, Period<DateTime> produced, int prodRate, Boolean standardType = true)
     : base(manufacturer,TypeOfAirliner.Passenger,name,family,cockpitcrew,speed,range,wingspan,length,consumption,price,minRunwaylength,fuelcapacity,body,rangeType,engine,produced, prodRate,standardType)
 {
     this.MaxSeatingCapacity = seating;
     this.CabinCrew = cabincrew;
     this.MaxAirlinerClasses = maxAirlinerClasses;
 }
 public AirlinerType(Manufacturer manufacturer,TypeOfAirliner typeOfAirliner, string name,string family, int cockpitCrew, double speed, long range, double wingspan, double length, double consumption, long price,long minRunwaylength, long fuelcapacity, BodyType body, TypeRange rangeType, EngineType engine, Period<DateTime> produced,int prodRate, Boolean standardType)
 {
     this.TypeAirliner = typeOfAirliner;
     this.AirlinerFamily = family;
     this.Manufacturer = manufacturer;
     this.Name = name;
     this.CruisingSpeed = speed;
     this.Range = range;
     this.Wingspan = wingspan;
     this.Length = length;
     this.CockpitCrew = cockpitCrew;
     this.Price = price;
     this.FuelConsumption = consumption;
     this.Produced = produced;
     this.Engine = engine;
     this.Body = body;
     this.RangeType = rangeType;
     this.MinRunwaylength = minRunwaylength;
     this.FuelCapacity = fuelcapacity;
     this.IsStandardType = standardType;
     this.ProductionRate = prodRate;
 }
 public AirlinerCargoType(Manufacturer manufacturer, string name,string family, int cockpitcrew, double cargoSize,  double speed, long range, double wingspan, double length, double consumption, long price, long minRunwaylength, long fuelcapacity, BodyType body, TypeRange rangeType, EngineType engine, Period<DateTime> produced, int prodRate, Boolean standardType = true)
     : base(manufacturer,TypeOfAirliner.Cargo,name,family,cockpitcrew,speed,range,wingspan,length,consumption,price,minRunwaylength,fuelcapacity,body,rangeType,engine,produced, prodRate,standardType)
 {
     this.CargoSize = cargoSize;
 }
Beispiel #4
0
        /*!loads the engine types
         */
        private static void LoadEngineTypes()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(AppSettings.getDataPath() + "\\engines.xml");

            XmlElement root = doc.DocumentElement;

            XmlNodeList enginesList = root.SelectNodes("//engine");

            foreach (XmlElement engineElement in enginesList)
            {
                string manufacturerName = engineElement.Attributes["manufacturer"].Value;
                string name = engineElement.Attributes["model"].Value;

                XmlElement specsElement = (XmlElement)engineElement.SelectSingleNode("specs");
                EngineType.TypeOfEngine engineType = (EngineType.TypeOfEngine)Enum.Parse(typeof(EngineType.TypeOfEngine), specsElement.Attributes["type"].Value);
                EngineType.NoiseLevel noiseLevel = (EngineType.NoiseLevel)Enum.Parse(typeof(EngineType.NoiseLevel), specsElement.Attributes["noise"].Value);
                double consumption = Convert.ToDouble(specsElement.Attributes["consumptionModifier"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);
                long price = Convert.ToInt64(specsElement.Attributes["price"].Value);

                XmlElement perfElement = (XmlElement)engineElement.SelectSingleNode("performance");
                int speed = Convert.ToInt32(perfElement.Attributes["maxspeed"].Value);
                int ceiling = Convert.ToInt32(perfElement.Attributes["ceiling"].Value);
                double runway = Convert.ToDouble(perfElement.Attributes["runwaylengthrequiredModifier"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);
                double range = Convert.ToDouble(perfElement.Attributes["rangeModifier"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);

                XmlElement producedElement = (XmlElement)engineElement.SelectSingleNode("produced");
                int from = Convert.ToInt16(producedElement.Attributes["from"].Value);
                int to = Convert.ToInt16(producedElement.Attributes["to"].Value);

                XmlElement aircraftElement = (XmlElement)engineElement.SelectSingleNode("aircraft");
                string modelsElement = aircraftElement.Attributes["models"].Value;

                EngineType engine = new EngineType(name, manufacturerName, engineType, noiseLevel, consumption, price, speed, ceiling, runway, range, new Period<int>(from, to));

                string[] models = modelsElement.Split(',');

                foreach (string model in models)
                {
                    AirlinerType airlinerType = AirlinerTypes.GetAllTypes().FirstOrDefault(a => a.Name == model.Trim());

                    if (airlinerType != null)
                    {
                        engine.addAirlinerType(airlinerType);
                    }
                    else
                    {

                    }
                }

            }
        }
Beispiel #5
0
 //adds an engine type to the list
 public static void AddEngineType(EngineType type)
 {
     types.Add(type);
 }
Beispiel #6
0
 public AirlinerCombiType(Manufacturer manufacturer, string name, string family, int seating, int cockpitcrew, int cabincrew, double speed, long range, double wingspan, double length, double consumption, long price, int maxAirlinerClasses, long minRunwaylength, long fuelcapacity, BodyType body, TypeRange rangeType, EngineType engine, Period<DateTime> produced, int prodRate, double cargo, Boolean isConvertable, Boolean standardType = true)
     : base(manufacturer, name, family, seating, cockpitcrew, cabincrew, speed, range, wingspan, length, consumption, price, maxAirlinerClasses, minRunwaylength, fuelcapacity, body, rangeType, engine, produced, prodRate, isConvertable, standardType)
 {
     this.CargoSize = cargo;
     this.TypeAirliner = TypeOfAirliner.Mixed;
 }
Beispiel #7
0
 //adds an engine type to the list
 public static void AddEngineType(EngineType type)
 {
     types.Add(type);
 }