Example #1
0
        public Airline(
            AirlineProfile profile,
            AirlineMentality mentality,
            AirlineFocus marketFocus,
            AirlineLicense license,
            Route.RouteType routeFocus)
        {
            Scores = new AirlineScores();
            Shares = new List<AirlineShare>();
            Airports = new List<Airport>();
            Fleet = new List<FleetAirliner>();
            Routes = new List<Route>();
            FutureAirlines = new List<FutureSubsidiaryAirline>();
            Subsidiaries = new List<SubsidiaryAirline>();
            Advertisements = new Dictionary<AdvertisementType.AirlineAdvertisementType, AdvertisementType>();
            Codeshares = new List<CodeshareAgreement>();
            Statistics = new GeneralStatistics();
            Facilities = new List<AirlineFacility>();
            Invoices = new Invoices();
            Budget = new AirlineBudget();
            BudgetHistory = new Dictionary<DateTime, AirlineBudget>();
            TestBudget = new Dictionary<DateTime, AirlineBudget>();
            Profile = profile;
            AirlineRouteFocus = routeFocus;
            Loans = new List<Loan>();
            Reputation = 50;
            Alliances = new List<Alliance>();
            Mentality = mentality;
            MarketFocus = marketFocus;
            License = license;
            Policies = new List<AirlinePolicy>();
            EventLog = new List<RandomEvent>();
            Ratings = new AirlineRatings();
            OverallScore = CountedScores = 0;
            GameScores = new Dictionary<DateTime, int>();
            InsuranceClaims = new List<InsuranceClaim>();
            InsurancePolicies = new List<AirlineInsurance>();
            SpecialContracts = new List<SpecialContract>();

            CreateStandardAdvertisement();

            Pilots = new List<Pilot>();
            FlightSchools = new List<FlightSchool>();
            Budget = new AirlineBudget();
        }
        //verifies to make sure sub-budgets don't exceed master budget
        public static void VerifyValues(AirlineBudget budget)
        {
            long userMarketingBudget = budget.RadioBudget + budget.TelevisionBudget + budget.PrintBudget
                                       + budget.InternetBudget;
            if (userMarketingBudget > budget.MarketingBudget)
            {
                budget.RadioBudget =
                    budget.TelevisionBudget = budget.PrintBudget = budget.InternetBudget = budget.MarketingBudget/4;
            }

            long userMaintBudget = budget.PartsBudget + budget.EnginesBudget + budget.OverhaulBudget
                                   + budget.RemoteBudget;
            if (userMaintBudget > budget.MaintenanceBudget)
            {
                budget.PartsBudget =
                    budget.EnginesBudget = budget.OverhaulBudget = budget.RemoteBudget = budget.MaintenanceBudget/4;
            }

            long userCSBudget = budget.ServCenterBudget + budget.CompBudget + budget.PromoBudget + budget.PRBudget;
            if (userCSBudget > budget.CSBudget)
            {
                budget.ServCenterBudget = budget.CompBudget = budget.PromoBudget = budget.PRBudget = budget.CSBudget/4;
            }

            long userSecurityBudget = budget.AirportBudget + budget.EquipmentBudget + budget.InFlightBudget
                                      + budget.ITBudget;
            if (userSecurityBudget > budget.SecurityBudget)
            {
                budget.AirportBudget =
                    budget.EquipmentBudget = budget.InFlightBudget = budget.ITBudget = budget.SecurityBudget/4;
            }
        }
Example #3
0
 public void StoreBudget(AirlineBudget budget)
 {
     BudgetHistory.Add(GameObject.GetInstance().GameTime, budget);
 }