diff --git a/game/campaignloader/campaign.py b/game/campaignloader/campaign.py index 039dabc1..f72a4553 100644 --- a/game/campaignloader/campaign.py +++ b/game/campaignloader/campaign.py @@ -18,7 +18,6 @@ from game.theater import ( MarianaIslandsTheater, NevadaTheater, NormandyTheater, - PersianGulfTheater, SyriaTheater, TheChannelTheater, ) @@ -117,7 +116,6 @@ class Campaign: def load_theater(self, advanced_iads: bool) -> ConflictTheater: theaters = { "Nevada": NevadaTheater, - "Persian Gulf": PersianGulfTheater, "Normandy": NormandyTheater, "The Channel": TheChannelTheater, "Syria": SyriaTheater, diff --git a/game/theater/conflicttheater.py b/game/theater/conflicttheater.py index 29c32f45..e6600331 100644 --- a/game/theater/conflicttheater.py +++ b/game/theater/conflicttheater.py @@ -12,7 +12,6 @@ from dcs.terrain import ( marianaislands, nevada, normandy, - persiangulf, syria, thechannel, ) @@ -246,27 +245,6 @@ class ConflictTheater: return Heading.from_degrees(position.heading_between_point(conflict_center)) -class PersianGulfTheater(ConflictTheater): - terrain = persiangulf.PersianGulf() - landmap = load_landmap(Path("resources/gulflandmap.p")) - daytime_map = DaytimeMap( - dawn=(datetime.time(hour=6), datetime.time(hour=8)), - day=(datetime.time(hour=8), datetime.time(hour=16)), - dusk=(datetime.time(hour=16), datetime.time(hour=18)), - night=(datetime.time(hour=0), datetime.time(hour=5)), - ) - - @property - def timezone(self) -> datetime.timezone: - return datetime.timezone(datetime.timedelta(hours=4)) - - @property - def seasonal_conditions(self) -> SeasonalConditions: - from .seasonalconditions.persiangulf import CONDITIONS - - return CONDITIONS - - class NevadaTheater(ConflictTheater): terrain = nevada.Nevada() landmap = load_landmap(Path("resources/nevlandmap.p")) diff --git a/game/theater/seasonalconditions/persiangulf.py b/game/theater/seasonalconditions/persiangulf.py deleted file mode 100644 index 923b887d..00000000 --- a/game/theater/seasonalconditions/persiangulf.py +++ /dev/null @@ -1,37 +0,0 @@ -from .seasonalconditions import SeasonalConditions, Season, WeatherTypeChances - -CONDITIONS = SeasonalConditions( - summer_avg_pressure=29.98, # TODO: Find real-world data - winter_avg_pressure=29.80, # TODO: Find real-world data - summer_avg_temperature=32.5, - winter_avg_temperature=15.0, - temperature_day_night_difference=2.0, - weather_type_chances={ - # TODO: Find real-world data for all these values - Season.Winter: WeatherTypeChances( - # Winter there is some rain in PG (Dubai) - thunderstorm=1, - raining=15, - cloudy=40, - clear_skies=45, - ), - Season.Spring: WeatherTypeChances( - thunderstorm=1, - raining=2, - cloudy=28, - clear_skies=70, - ), - Season.Summer: WeatherTypeChances( - thunderstorm=1, - raining=1, - cloudy=18, - clear_skies=80, - ), - Season.Fall: WeatherTypeChances( - thunderstorm=1, - raining=2, - cloudy=28, - clear_skies=70, - ), - }, -) diff --git a/game/theater/theaterloader.py b/game/theater/theaterloader.py index f94100a5..0df987d5 100644 --- a/game/theater/theaterloader.py +++ b/game/theater/theaterloader.py @@ -66,7 +66,7 @@ class TheaterLoader: with self.descriptor_path.open() as descriptor_file: data = yaml.safe_load(descriptor_file) return YamlTheater( - TERRAINS_BY_NAME[data["name"]], + TERRAINS_BY_NAME[data.get("pydcs_name", data["name"])], load_landmap(self.descriptor_path.with_name("landmap.p")), datetime.timezone(datetime.timedelta(hours=data["timezone"])), self._load_seasonal_conditions(data["climate"]), diff --git a/resources/theaters/persian gulf/info.yaml b/resources/theaters/persian gulf/info.yaml new file mode 100644 index 00000000..0f9d01ce --- /dev/null +++ b/resources/theaters/persian gulf/info.yaml @@ -0,0 +1,40 @@ +--- +name: Persian Gulf +pydcs_name: PersianGulf +timezone: +4 +daytime: + dawn: [6, 8] + day: [8, 16] + dusk: [16, 18] + night: [0, 5] +climate: + day_night_temperature_difference: 2.0 + seasons: + winter: + average_pressure: 29.80 # TODO: Find real-world data + average_temperature: 15.0 + weather: + thunderstorm: 1 + raining: 15 + cloudy: 40 + clear: 45 + spring: + weather: + thunderstorm: 1 + raining: 2 + cloudy: 28 + clear: 70 + summer: + average_pressure: 29.98 # TODO: Find real-world data + average_temperature: 32.5 + weather: + thunderstorm: 1 + raining: 1 + cloudy: 18 + clear: 80 + fall: + weather: + thunderstorm: 1 + raining: 2 + cloudy: 28 + clear: 70 diff --git a/resources/gulflandmap.p b/resources/theaters/persian gulf/landmap.p similarity index 100% rename from resources/gulflandmap.p rename to resources/theaters/persian gulf/landmap.p