상속: INotifyPropertyChanged
예제 #1
0
        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)
            {
                AirlinerClass eClass = new AirlinerClass(AirlinerClass.ClassType.Economy_Class, ((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);

            var homebases = AirlineHelpers.GetHomebases(GameObject.GetInstance().HumanAirline, minRunway);

            foreach (var homebase in homebases)
            {
                this.Homebases.Add(homebase);
            }
        }
예제 #2
0
        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)
            {
                AirlinerClass eClass = new AirlinerClass(AirlinerClass.ClassType.Economy_Class, ((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);

            var homebases = AirlineHelpers.GetHomebases(GameObject.GetInstance().HumanAirline, minRunway);

            foreach (var homebase in homebases)
                this.Homebases.Add(homebase);
        }
        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;
        }