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:
Eclipse/Druss99
2025-01-17 17:02:07 -05:00
committed by Raffson
parent 362ce66f80
commit 31c80dfd02
78 changed files with 739 additions and 350 deletions

View File

@@ -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
),
)