/*! create some game airliners. */ public static void CreateStartUpAirliners() { int number = AirlinerTypes.GetTypes(delegate(AirlinerType t) { return(t.Produced.From <= GameObject.GetInstance().GameTime&& t.Produced.To.AddYears(-10) >= GameObject.GetInstance().GameTime.AddYears(-30)); }).Count *rnd.Next(1, 3); int airlines = Airlines.GetNumberOfAirlines(); number = (airlines * number) / 5; for (int i = 0; i < number; i++) { Airliners.AddAirliner(CreateAirliner(0)); } }
//returns the average employee wages public static double GetAverageEmployeeWages() { var numberOfAirlines = Airlines.GetNumberOfAirlines(); Dictionary <Airline, Double> airlineWages = new Dictionary <Airline, double>(GetEmployeeWages()); double totalWages = 0; foreach (Airline airline in Airlines.GetAllAirlines()) { totalWages += GetEmployeeWages()[airline]; } return(totalWages / numberOfAirlines); }
//returns the average employee wages for the competitors for an airlines public static double GetAverageEmployeeWages(Airline airline) { var numberOfAirlines = Airlines.GetNumberOfAirlines() - 1; Dictionary <Airline, Double> airlineWages = new Dictionary <Airline, double>(GetEmployeeWages()); double totalWages = 0; foreach (Airline competitor in Airlines.GetAllAirlines()) { if (competitor != airline) { totalWages += GetEmployeeWages()[competitor]; } } return(totalWages / numberOfAirlines); }