Esempio n. 1
0
        //creates a number of instructors
        public static void CreateInstructors(int count)
        {
            List <Town> towns = Towns.GetTowns();

            Random rnd = new Random();

            for (int i = 0; i < count; i++)
            {
                Town         town      = towns[rnd.Next(towns.Count)];
                DateTime     birthdate = MathHelpers.GetRandomDate(GameObject.GetInstance().GameTime.AddYears(-Pilot.RetirementAge), GameObject.GetInstance().GameTime.AddYears(-23));
                PilotProfile profile   = new PilotProfile(Names.GetInstance().getRandomFirstName(town.Country), Names.GetInstance().getRandomLastName(town.Country), birthdate, town);

                Dictionary <PilotRating, int> rankings = new Dictionary <PilotRating, int>();
                rankings.Add(PilotRatings.GetRating("A"), 10);
                rankings.Add(PilotRatings.GetRating("B"), 20);
                rankings.Add(PilotRatings.GetRating("C"), 40);
                rankings.Add(PilotRatings.GetRating("D"), 20);
                rankings.Add(PilotRatings.GetRating("E"), 10);

                PilotRating ranking = AIHelpers.GetRandomItem <PilotRating>(rankings);

                Instructor instructor = new Instructor(profile, ranking);

                Instructors.AddInstructor(instructor);
            }
        }
Esempio n. 2
0
        //returns a rating for a pilot
        public static PilotRating GetPilotRating()
        {
            Dictionary <PilotRating, int> ratings = new Dictionary <PilotRating, int>();

            ratings.Add(PilotRatings.GetRating("A"), 10);
            ratings.Add(PilotRatings.GetRating("B"), 20);
            ratings.Add(PilotRatings.GetRating("C"), 40);
            ratings.Add(PilotRatings.GetRating("D"), 20);
            ratings.Add(PilotRatings.GetRating("E"), 10);

            return(AIHelpers.GetRandomItem <PilotRating>(ratings));
        }