Migrate Marianas to YAML.

This commit is contained in:
Dan Albert 2022-09-07 16:18:19 -07:00 committed by Raffson
parent 06652cd063
commit f08955ae53
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
5 changed files with 40 additions and 63 deletions

View File

@ -15,7 +15,6 @@ from game.profiling import logged_duration
from game.theater import (
ConflictTheater,
FalklandsTheater,
MarianaIslandsTheater,
NevadaTheater,
NormandyTheater,
TheChannelTheater,
@ -117,7 +116,6 @@ class Campaign:
"Nevada": NevadaTheater,
"Normandy": NormandyTheater,
"The Channel": TheChannelTheater,
"MarianaIslands": MarianaIslandsTheater,
"Falklands": FalklandsTheater,
}
try:

View File

@ -9,7 +9,6 @@ from uuid import UUID
from dcs.mapping import Point
from dcs.terrain import (
falklands,
marianaislands,
nevada,
normandy,
thechannel,
@ -307,28 +306,6 @@ class TheChannelTheater(ConflictTheater):
return CONDITIONS
class MarianaIslandsTheater(ConflictTheater):
terrain = marianaislands.MarianaIslands()
landmap = load_landmap(Path("resources/marianaislandslandmap.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=10))
@property
def seasonal_conditions(self) -> SeasonalConditions:
from .seasonalconditions.marianaislands import CONDITIONS
return CONDITIONS
class FalklandsTheater(ConflictTheater):
terrain = falklands.Falklands()

View File

@ -1,38 +0,0 @@
from .seasonalconditions import SeasonalConditions, Season, WeatherTypeChances
CONDITIONS = SeasonalConditions(
summer_avg_pressure=30.02, # TODO: Find real-world data
winter_avg_pressure=29.82, # TODO: Find real-world data
summer_avg_temperature=28.0,
winter_avg_temperature=27.0,
temperature_day_night_difference=1.0,
weather_type_chances={
# TODO: Find real-world data for all these values
Season.Winter: WeatherTypeChances(
thunderstorm=2,
raining=20,
cloudy=40,
clear_skies=40,
),
Season.Spring: WeatherTypeChances(
# Spring is dry/sunny in Marianas
thunderstorm=1,
raining=10,
cloudy=30,
clear_skies=60,
),
Season.Summer: WeatherTypeChances(
thunderstorm=2,
raining=20,
cloudy=40,
clear_skies=40,
),
Season.Fall: WeatherTypeChances(
# Rain season
thunderstorm=5,
raining=45,
cloudy=30,
clear_skies=20,
),
},
)

View File

@ -0,0 +1,40 @@
---
name: Mariana Islands
pydcs_name: MarianaIslands
timezone: +10
daytime:
dawn: [6, 8]
day: [8, 16]
dusk: [16, 18]
night: [0, 5]
climate:
day_night_temperature_difference: 6.0
seasons:
winter:
average_pressure: 29.82 # TODO: Find real-world data
average_temperature: 27.0
weather:
thunderstorm: 2
raining: 20
cloudy: 40
clear: 40
spring:
weather:
thunderstorm: 1
raining: 10
cloudy: 30
clear: 60
summer:
average_pressure: 30.02 # TODO: Find real-world data
average_temperature: 28.0
weather:
thunderstorm: 2
raining: 20
cloudy: 40
clear: 40
fall:
weather:
thunderstorm: 5
raining: 45
cloudy: 30
clear: 20