Пример #1
0
        //sets up an scenario airline route
        private static void SetupScenarioRoute(ScenarioAirlineRoute saroute, Airline airline)
        {
            SetupScenarioAirport(airline, saroute.Destination1, saroute.Quantity);
            SetupScenarioAirport(airline, saroute.Destination2, saroute.Quantity);

            double price = PassengerHelpers.GetPassengerPrice(saroute.Destination1, saroute.Destination2);

            for (int i = 0; i < saroute.Quantity; i++)
            {
                Guid id = Guid.NewGuid();

                PassengerRoute route = new PassengerRoute(id.ToString(), saroute.Destination1, saroute.Destination2, price);

                RouteClassesConfiguration configuration = AIHelpers.GetRouteConfiguration(route);

                foreach (RouteClassConfiguration classConfiguration in configuration.getClasses())
                {
                    route.getRouteAirlinerClass(classConfiguration.Type).FarePrice = price * GeneralHelpers.ClassToPriceFactor(classConfiguration.Type);

                    foreach (RouteFacility rfacility in classConfiguration.getFacilities())
                        route.getRouteAirlinerClass(classConfiguration.Type).addFacility(rfacility);
                }

                 airline.addRoute(route);

                FleetAirliner fAirliner = AirlineHelpers.CreateAirliner(airline, saroute.AirlinerType);
                airline.addAirliner(fAirliner);

                fAirliner.addRoute(route);

                AIHelpers.CreateRouteTimeTable(route, fAirliner);

                fAirliner.Status = FleetAirliner.AirlinerStatus.To_route_start;
                AirlineHelpers.HireAirlinerPilots(fAirliner);

                route.LastUpdated = GameObject.GetInstance().GameTime;
            }
        }
Пример #2
0
 //adds a route to the scenario
 public void addRoute(ScenarioAirlineRoute route)
 {
     this.Routes.Add(route);
 }
Пример #3
0
 //adds a route to the scenario
 public void addRoute(ScenarioAirlineRoute route)
 {
     this.Routes.Add(route);
 }