mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
refactor of previous commits
refactor to enum typing and many other fixes fix tests attempt to fix some typescript more typescript fixes more typescript test fixes revert all API changes update to pydcs mypy fixes Use properties to check if player is blue/red/neutral update requirements.txt black -_- bump pydcs and fix mypy add opponent property bump pydcs
This commit is contained in:
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
|
||||
from pydantic import BaseModel
|
||||
|
||||
from game.server.leaflet import LeafletPoint, LeafletPoly, ShapelyUtil
|
||||
from game.theater import ConflictTheater
|
||||
from game.theater import ConflictTheater, Player
|
||||
from game.threatzones import ThreatZones
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -85,9 +85,9 @@ class ThreatZoneContainerJs(BaseModel):
|
||||
def for_game(game: Game) -> ThreatZoneContainerJs:
|
||||
return ThreatZoneContainerJs(
|
||||
blue=ThreatZonesJs.from_zones(
|
||||
game.threat_zone_for(player=True), game.theater
|
||||
game.threat_zone_for(player=Player.BLUE), game.theater
|
||||
),
|
||||
red=ThreatZonesJs.from_zones(
|
||||
game.threat_zone_for(player=False), game.theater
|
||||
game.threat_zone_for(player=Player.RED), game.theater
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user