mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Handle map reset when the game is loaded/unloaded.
https://github.com/dcs-liberation/dcs_liberation/issues/2039 Partial fix for https://github.com/dcs-liberation/dcs_liberation/issues/2045 (now works in the new map, old one not fixed yet).
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from game.server.leaflet import LeafletPoint
|
||||
from game.theater import ControlPoint
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game import Game
|
||||
from game.theater import ControlPoint
|
||||
|
||||
|
||||
class ControlPointJs(BaseModel):
|
||||
@@ -29,3 +34,9 @@ class ControlPointJs(BaseModel):
|
||||
destination=destination,
|
||||
sidc=str(control_point.sidc()),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def all_in_game(game: Game) -> list[ControlPointJs]:
|
||||
return [
|
||||
ControlPointJs.for_control_point(cp) for cp in game.theater.controlpoints
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user