CreateBasicFacilities() публичный Метод

public CreateBasicFacilities ( Airline airline ) : void
airline TheAirline.Models.Airlines.Airline
Результат void
Пример #1
0
        public Airliner(string id, AirlinerType type, string tailNumber, DateTime builtDate)
        {
            ID = id;
            BuiltDate = new DateTime(builtDate.Year, builtDate.Month, builtDate.Day);
            Type = type;
            LastServiceCheck = 0;
            TailNumber = tailNumber;
            Flown = 0;
            Condition = _rnd.Next(90, 100);
            Status = StatusTypes.Normal;

            Classes = new List<AirlinerClass>();

            if (Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger)
            {
                var aClass = new AirlinerClass(
                    AirlinerClass.ClassType.EconomyClass,
                    ((AirlinerPassengerType) Type).MaxSeatingCapacity);
                aClass.CreateBasicFacilities(Airline);
                Classes.Add(aClass);
            }

            if (Type.TypeAirliner == AirlinerType.TypeOfAirliner.Cargo)
            {
                var aClass = new AirlinerClass(AirlinerClass.ClassType.EconomyClass, 0);
                aClass.CreateBasicFacilities(Airline);
                Classes.Add(aClass);
            }
        }
Пример #2
0
 //adds a new airliner class to the airliner
 public void AddAirlinerClass(AirlinerClass airlinerClass)
 {
     if (airlinerClass != null)
     {
         if (Classes.Exists(c => c.Type == airlinerClass.Type))
         {
             Classes[Classes.FindIndex(c => c.Type == airlinerClass.Type)] = airlinerClass;
         }
         else
         {
             Classes.Add(airlinerClass);
             if (airlinerClass.GetFacilities().Count == 0)
             {
                 airlinerClass.CreateBasicFacilities(Airline);
             }
         }
     }
 }
        public AirlinerOrderMVVM(AirlinerType type, AirlinerOrdersMVVM order, int amount = 1)
        {
            this.Type = type;
            this.Order = order;
            this.Amount = amount;
            this._classes = new List<AirlinerClass>();
            this.Homebases = new List<Airport>();

            if (this.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger || this.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Helicopter)
            {
                var eClass = new AirlinerClass(
                    AirlinerClass.ClassType.EconomyClass,
                    ((AirlinerPassengerType)type).MaxSeatingCapacity);
                eClass.CreateBasicFacilities(null);
                this.Classes.Add(eClass);
            }

            long minRunway = this.Type.MinRunwaylength;

            //var homebases = GameObject.GetInstance().HumanAirline.Airports.FindAll(a => (a.hasContractType(GameObject.GetInstance().HumanAirline, AirportContract.ContractType.Full_Service) || a.getCurrentAirportFacility(GameObject.GetInstance().HumanAirline, AirportFacility.FacilityType.Service).TypeLevel > 0) && a.getMaxRunwayLength() >= minRunway);

            List<Airport> homebases = AirlineHelpers.GetHomebases(GameObject.GetInstance().HumanAirline, minRunway);

            foreach (Airport homebase in homebases)
            {
                this.Homebases.Add(homebase);
            }

            this.Engine = EngineTypes.GetStandardEngineType(this.Type, GameObject.GetInstance().GameTime.Year);

            this.ForConfig = this.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger || this.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Mixed || EngineTypes.GetEngineTypes(type,GameObject.GetInstance().GameTime.Year).Count > 0;
        }