Migrate Syria to yaml.

This commit is contained in:
Dan Albert 2022-09-07 16:11:38 -07:00 committed by Raffson
parent f3f067830f
commit 06652cd063
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
5 changed files with 39 additions and 60 deletions

View File

@ -18,7 +18,6 @@ from game.theater import (
MarianaIslandsTheater,
NevadaTheater,
NormandyTheater,
SyriaTheater,
TheChannelTheater,
)
from game.theater.iadsnetwork.iadsnetwork import IadsNetwork
@ -118,7 +117,6 @@ class Campaign:
"Nevada": NevadaTheater,
"Normandy": NormandyTheater,
"The Channel": TheChannelTheater,
"Syria": SyriaTheater,
"MarianaIslands": MarianaIslandsTheater,
"Falklands": FalklandsTheater,
}

View File

@ -12,7 +12,6 @@ from dcs.terrain import (
marianaislands,
nevada,
normandy,
syria,
thechannel,
)
from dcs.terrain.terrain import Terrain
@ -308,27 +307,6 @@ class TheChannelTheater(ConflictTheater):
return CONDITIONS
class SyriaTheater(ConflictTheater):
terrain = syria.Syria()
landmap = load_landmap(Path("resources/syrialandmap.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=3))
@property
def seasonal_conditions(self) -> SeasonalConditions:
from .seasonalconditions.syria import CONDITIONS
return CONDITIONS
class MarianaIslandsTheater(ConflictTheater):
terrain = marianaislands.MarianaIslands()

View File

@ -1,36 +0,0 @@
from .seasonalconditions import SeasonalConditions, Season, WeatherTypeChances
CONDITIONS = SeasonalConditions(
summer_avg_pressure=29.98, # TODO: Find real-world data
winter_avg_pressure=29.86, # TODO: Find real-world data
summer_avg_temperature=28.5,
winter_avg_temperature=10.0,
temperature_day_night_difference=8.0,
weather_type_chances={
# TODO: Find real-world data for all these values
Season.Winter: WeatherTypeChances(
thunderstorm=1,
raining=25,
cloudy=35,
clear_skies=40,
),
Season.Spring: WeatherTypeChances(
thunderstorm=1,
raining=10,
cloudy=30,
clear_skies=60,
),
Season.Summer: WeatherTypeChances(
thunderstorm=1,
raining=5,
cloudy=30,
clear_skies=65,
),
Season.Fall: WeatherTypeChances(
thunderstorm=1,
raining=15,
cloudy=35,
clear_skies=50,
),
},
)

View File

@ -0,0 +1,39 @@
---
name: Syria
timezone: +3
daytime:
dawn: [6, 8]
day: [8, 16]
dusk: [16, 18]
night: [0, 5]
climate:
day_night_temperature_difference: 8.0
seasons:
winter:
average_pressure: 29.86 # TODO: Find real-world data
average_temperature: 10.0
weather:
thunderstorm: 1
raining: 25
cloudy: 35
clear: 40
spring:
weather:
thunderstorm: 1
raining: 10
cloudy: 30
clear: 60
summer:
average_pressure: 29.98 # TODO: Find real-world data
average_temperature: 28.5
weather:
thunderstorm: 1
raining: 5
cloudy: 30
clear: 65
fall:
weather:
thunderstorm: 1
raining: 15
cloudy: 35
clear: 50