Beispiel #1
0
        private bool Load(INIFile ini)
        {
            BriefingMissionName        = ini.GetValue("Briefing", "MissionName", BriefingMissionName);
            BriefingMissionDescription = ini.GetValue("Briefing", "MissionDescription", BriefingMissionDescription);

            ContextCoalitionBlue   = ini.GetValue("Context", "CoalitionBlue", ContextCoalitionBlue);
            ContextCoalitionRed    = ini.GetValue("Context", "CoalitionRed", ContextCoalitionRed);
            ContextDecade          = ini.GetValue("Context", "Decade", ContextDecade);
            ContextPlayerCoalition = ini.GetValue("Context", "PlayerCoalition", ContextPlayerCoalition);
            ContextTheater         = ini.GetValue("Context", "Theater", ContextTheater);
            ContextSituation       = ini.GetValue("Context", "Situation", ContextSituation);

            EnvironmentSeason        = ini.GetValue("Environment", "Season", EnvironmentSeason);
            EnvironmentTimeOfDay     = ini.GetValue("Environment", "TimeOfDay", EnvironmentTimeOfDay);
            EnvironmentWeatherPreset = ini.GetValue("Environment", "WeatherPreset", EnvironmentWeatherPreset);
            EnvironmentWind          = ini.GetValue("Environment", "Wind", EnvironmentWind);

            FlightPlanObjectiveDistance      = ini.GetValue("FlightPlan", "ObjectiveDistance", FlightPlanObjectiveDistance);
            FlightPlanObjectiveSeperation    = ini.GetValue("FlightPlan", "ObjectiveSeperation", FlightPlanObjectiveSeperation);
            FlightPlanTheaterStartingAirbase = ini.GetValue("FlightPlan", "TheaterStartingAirbase", FlightPlanTheaterStartingAirbase);

            MissionFeatures = ini.GetValueDistinctList <string>("MissionFeatures", "MissionFeatures");

            Mods = ini.GetValueArray <string>("Mods", "Mods").ToList();

            Objectives.Clear();
            foreach (string key in ini.GetTopLevelKeysInSection("Objectives"))
            {
                Objectives.Add(new MissionTemplateObjective(ini, "Objectives", key));
            }

            OptionsFogOfWar = ini.GetValue("Options", "FogOfWar", OptionsFogOfWar);
            OptionsMission  = ini.GetValueDistinctList <string>("Options", "Mission");
            OptionsRealism  = ini.GetValueDistinctList <RealismOption>("Options", "Realism");

            PlayerFlightGroups.Clear();
            foreach (string key in ini.GetTopLevelKeysInSection("PlayerFlightGroups"))
            {
                PlayerFlightGroups.Add(new MissionTemplateFlightGroup(ini, "PlayerFlightGroups", key));
            }

            AircraftPackages.Clear();
            foreach (string key in ini.GetTopLevelKeysInSection("AircraftPackages"))
            {
                AircraftPackages.Add(new MissionTemplatePackage(ini, "AircraftPackages", key));
            }

            SituationEnemySkill      = ini.GetValue("Situation", "EnemySkill", SituationEnemySkill);
            SituationEnemyAirDefense = ini.GetValue("Situation", "EnemyAirDefense", SituationEnemyAirDefense);
            SituationEnemyAirForce   = ini.GetValue("Situation", "EnemyAirForce", SituationEnemyAirForce);

            SituationFriendlySkill      = ini.GetValue("Situation", "FriendlySkill", SituationFriendlySkill);
            SituationFriendlyAirDefense = ini.GetValue("Situation", "FriendlyAirDefense", SituationFriendlyAirDefense);
            SituationFriendlyAirForce   = ini.GetValue("Situation", "FriendlyAirForce", SituationFriendlyAirForce);

            AssignAliases();
            return(true);
        }
Beispiel #2
0
 internal void AssignAliases()
 {
     foreach (var item in PlayerFlightGroups)
     {
         item.AssignAlias(PlayerFlightGroups.IndexOf(item));
     }
     foreach (var item in Objectives)
     {
         item.AssignAlias(Objectives.IndexOf(item));
     }
     foreach (var item in AircraftPackages)
     {
         item.AssignAlias(AircraftPackages.IndexOf(item));
     }
 }