AddSubsidiaryAirline() public method

public AddSubsidiaryAirline ( SubsidiaryAirline subsidiary ) : void
subsidiary TheAirline.Models.Airlines.Subsidiary.SubsidiaryAirline
return void
        //adds a subsidiary airline to an airline
        public static void AddSubsidiaryAirline(Airline airline, SubsidiaryAirline sAirline, double money, Airport airportHomeBase)
        {
            Terminal.TerminalType terminaltype = sAirline.AirlineRouteFocus == Route.RouteType.Cargo ? Terminal.TerminalType.Cargo : Terminal.TerminalType.Passenger;
            AddAirlineInvoice(airline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.AirlineExpenses, -money);
            sAirline.Money = money;
            sAirline.StartMoney = money;

            sAirline.Fees = new AirlineFees();

            airline.AddSubsidiaryAirline(sAirline);

            if (!AirportHelpers.HasFreeGates(airportHomeBase, sAirline, terminaltype) && airportHomeBase.Terminals.GetFreeGates(terminaltype) > 1)
            {
                AirportHelpers.RentGates(airportHomeBase, sAirline, AirportContract.ContractType.Full, terminaltype, 2);
                //sets all the facilities at an airport to none for all airlines
                foreach (Airport airport in Airports.GetAllAirports())
                {
                    foreach (AirportFacility.FacilityType type in Enum.GetValues(typeof (AirportFacility.FacilityType)))
                    {
                        AirportFacility noneFacility = AirportFacilities.GetFacilities(type).Find((facility => facility.TypeLevel == 0));

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


                AirportFacility serviceFacility = AirportFacilities.GetFacilities(AirportFacility.FacilityType.Service).Find(f => f.TypeLevel == 1);
                AirportFacility checkinFacility = AirportFacilities.GetFacilities(AirportFacility.FacilityType.CheckIn).Find(f => f.TypeLevel == 1);

                airportHomeBase.AddAirportFacility(sAirline, serviceFacility, GameObject.GetInstance().GameTime);
                airportHomeBase.AddAirportFacility(sAirline, checkinFacility, GameObject.GetInstance().GameTime);
            }

            foreach (AirlinePolicy policy in airline.Policies)
                sAirline.AddAirlinePolicy(policy);

            Airlines.AddAirline(sAirline);
        }