AddPilot() public méthode

public AddPilot ( Pilot pilot ) : void
pilot TheAirline.Models.Pilots.Pilot
Résultat void
        //switches from one airline to another airline
        public static void SwitchAirline(Airline airlineFrom, Airline airlineTo)
        {
            while (airlineFrom.Alliances.Count > 0)
            {
                Alliance alliance = airlineFrom.Alliances[0];
                alliance.RemoveMember(airlineFrom);
                alliance.AddMember(new AllianceMember(airlineTo, GameObject.GetInstance().GameTime));
            }
            while (airlineFrom.Facilities.Count > 0)
            {
                AirlineFacility airlineFacility = airlineFrom.Facilities[0];
                airlineFrom.RemoveFacility(airlineFacility);
                airlineTo.AddFacility(airlineFacility);
            }


            while (airlineFrom.GetFleetSize() > 0)
            {
                FleetAirliner airliner = airlineFrom.Fleet[0];
                airlineFrom.RemoveAirliner(airliner);
                airlineTo.AddAirliner(airliner);
                airliner.Airliner.Airline = airlineTo;
            }

            while (airlineFrom.Routes.Count > 0)
            {
                Route route = airlineFrom.Routes[0];
                route.Airline = airlineTo;

                airlineFrom.RemoveRoute(route);
                airlineTo.AddRoute(route);
            }
            while (airlineFrom.Pilots.Count > 0)
            {
                Pilot pilot = airlineFrom.Pilots[0];
                airlineFrom.RemovePilot(pilot);

                pilot.Airline = airlineTo;
                airlineTo.AddPilot(pilot);
            }
            while (airlineFrom.Airports.Count > 0)
            {
                Airport airport = airlineFrom.Airports[0];
                airport.Terminals.SwitchAirline(airlineFrom, airlineTo);

                foreach (AirportFacility facility in airport.GetCurrentAirportFacilities(airlineFrom))
                {
                    if (facility.TypeLevel > airport.GetCurrentAirportFacility(airlineTo, facility.Type).TypeLevel)
                        airport.AddAirportFacility(airlineTo, facility, GameObject.GetInstance().GameTime);

                    AirportFacility noneFacility = AirportFacilities.GetFacilities(facility.Type).Find(f => f.TypeLevel == 0);

                    airport.AddAirportFacility(airlineFrom, noneFacility, GameObject.GetInstance().GameTime);
                }
            }
        }