Migrate Normandy to YAML.

This commit is contained in:
Dan Albert
2022-09-07 16:33:11 -07:00
committed by Raffson
parent ede1a8c567
commit 1c66f18e3f
5 changed files with 39 additions and 60 deletions

View File

@@ -15,7 +15,6 @@ from game.profiling import logged_duration
from game.theater import (
ConflictTheater,
FalklandsTheater,
NormandyTheater,
TheChannelTheater,
)
from game.theater.iadsnetwork.iadsnetwork import IadsNetwork
@@ -112,7 +111,6 @@ class Campaign:
def load_theater(self, advanced_iads: bool) -> ConflictTheater:
theaters = {
"Normandy": NormandyTheater,
"The Channel": TheChannelTheater,
"Falklands": FalklandsTheater,
}

View File

@@ -9,7 +9,6 @@ from uuid import UUID
from dcs.mapping import Point
from dcs.terrain import (
falklands,
normandy,
thechannel,
)
from dcs.terrain.terrain import Terrain
@@ -242,27 +241,6 @@ class ConflictTheater:
return Heading.from_degrees(position.heading_between_point(conflict_center))
class NormandyTheater(ConflictTheater):
terrain = normandy.Normandy()
landmap = load_landmap(Path("resources/normandylandmap.p"))
daytime_map = DaytimeMap(
dawn=(datetime.time(hour=6), datetime.time(hour=8)),
day=(datetime.time(hour=10), datetime.time(hour=17)),
dusk=(datetime.time(hour=17), 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=0))
@property
def seasonal_conditions(self) -> SeasonalConditions:
from .seasonalconditions.normandy import CONDITIONS
return CONDITIONS
class TheChannelTheater(ConflictTheater):
terrain = thechannel.TheChannel()
landmap = load_landmap(Path("resources/channellandmap.p"))

View File

@@ -1,36 +0,0 @@
from .seasonalconditions import SeasonalConditions, Season, WeatherTypeChances
CONDITIONS = SeasonalConditions(
summer_avg_pressure=30.02, # TODO: Find real-world data
winter_avg_pressure=29.72, # TODO: Find real-world data
summer_avg_temperature=20.0,
winter_avg_temperature=0.0,
temperature_day_night_difference=5.0,
weather_type_chances={
# TODO: Find real-world data for all these values
Season.Winter: WeatherTypeChances(
thunderstorm=1,
raining=20,
cloudy=60,
clear_skies=20,
),
Season.Spring: WeatherTypeChances(
thunderstorm=1,
raining=20,
cloudy=40,
clear_skies=40,
),
Season.Summer: WeatherTypeChances(
thunderstorm=1,
raining=10,
cloudy=35,
clear_skies=55,
),
Season.Fall: WeatherTypeChances(
thunderstorm=1,
raining=30,
cloudy=50,
clear_skies=20,
),
},
)