Initial support for Germany Cold War (#518)

* Initial support of Germany Cold War terrain

* Updated with latest beacon import

* Updated changelog and ran black

* Fixed the GermanyCW landmap and naming scheme

* Temporarily changed the requirements for pydcs to my branch (will switch back when merged)

* Updated landmap for germanycw with even fewer exclusions

* Removed unnecessary changes

* Updated requirements to lastest pydcs

* Fixed naming issues for Germany

* Update pydcs to latest commit for GCW support

* Add landmap to game.theater.__init__

* Update requirements.txt

* Resolve PyCharm type-waring

* Updated pydcs and exclusion of germany

* Updated land and sea shapefiles for Germany Cold War with new map limits

---------

Co-authored-by: Raffson <Raffson@users.noreply.github.com>
This commit is contained in:
Cedric Menard
2025-07-06 13:30:00 -04:00
committed by GitHub
parent 5254ef3442
commit 9a00a60cd4
26 changed files with 2268 additions and 2 deletions

View File

@@ -49,7 +49,9 @@ class GameJs(BaseModel):
iads_network=IadsNetworkJs.from_network(game.theater.iads_network),
threat_zones=ThreatZoneContainerJs.for_game(game),
navmeshes=NavMeshesJs.from_game(game),
map_center=game.theater.terrain.map_view_default.position.latlng(),
map_center=LeafletPoint.from_latlng(
game.theater.terrain.map_view_default.position.latlng()
),
unculled_zones=UnculledZoneJs.from_game(game),
map_zones=MapZonesJs.from_game(game),
)

View File

@@ -19,6 +19,10 @@ class LeafletPoint(BaseModel):
title = "LatLng"
@staticmethod
def from_latlng(latlng: LatLng) -> LeafletPoint:
return LeafletPoint(lat=latlng.lat, lng=latlng.lng)
LeafletLine = list[LeafletPoint]

View File

@@ -2,5 +2,6 @@ from .base import *
from .conflicttheater import *
from .controlpoint import *
from .frontline import FrontLine
from .landmap import *
from .missiontarget import MissionTarget
from .theatergroundobject import SamGroundObject

View File

@@ -12,6 +12,7 @@ from dcs.mission import Mission
from dcs.terrain.terrain import Terrain
from shapely import geometry, LineString
from shapely.geometry import MultiPolygon, Polygon
import shapely as shp
@dataclass(frozen=True)
@@ -28,6 +29,11 @@ class Landmap:
if not self.sea_zones.is_valid:
raise RuntimeError("Sea zones not valid")
# Generate Spatial Index using `prepare` to improve performance
shp.prepare(self.inclusion_zones)
shp.prepare(self.exclusion_zones)
shp.prepare(self.sea_zones)
@cached_property
def inclusion_zone_only(self) -> MultiPolygon:
return self.inclusion_zones - self.exclusion_zones - self.sea_zones

View File

@@ -20,6 +20,7 @@ from dcs.terrain import (
Kola,
Afghanistan,
Iraq,
GermanyColdWar,
)
from .conflicttheater import ConflictTheater, THEATER_RESOURCE_DIR
@@ -39,6 +40,7 @@ ALL_TERRAINS = [
Kola(),
Afghanistan(),
Iraq(),
GermanyColdWar(),
]
TERRAINS_BY_NAME = {t.name: t for t in ALL_TERRAINS}