mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Handle IADS updates properly.
This adds the missing events in the backend, and handles them properly in the front end.
This commit is contained in:
@@ -12,6 +12,7 @@ if TYPE_CHECKING:
|
||||
from game.ato import Flight, Package
|
||||
from game.sim.combat import FrozenCombat
|
||||
from game.theater import ControlPoint, FrontLine, TheaterGroundObject
|
||||
from game.theater.iadsnetwork.iadsnetwork import IadsNetworkNode
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -33,6 +34,8 @@ class GameUpdateEvents:
|
||||
deleted_front_lines: set[UUID] = field(default_factory=set)
|
||||
updated_tgos: set[UUID] = field(default_factory=set)
|
||||
updated_control_points: set[ControlPoint] = field(default_factory=set)
|
||||
updated_iads: set[IadsNetworkNode] = field(default_factory=set)
|
||||
deleted_iads_connections: set[UUID] = field(default_factory=set)
|
||||
reset_on_map_center: LatLng | None = None
|
||||
game_unloaded: bool = False
|
||||
new_turn: bool = False
|
||||
@@ -121,6 +124,14 @@ class GameUpdateEvents:
|
||||
self.updated_control_points.add(control_point)
|
||||
return self
|
||||
|
||||
def update_iads_node(self, iads_node: IadsNetworkNode) -> GameUpdateEvents:
|
||||
self.updated_iads.add(iads_node)
|
||||
return self
|
||||
|
||||
def delete_iads_connection(self, connection_id: UUID) -> GameUpdateEvents:
|
||||
self.deleted_iads_connections.add(connection_id)
|
||||
return self
|
||||
|
||||
def game_loaded(self, game: Game | None) -> GameUpdateEvents:
|
||||
if game is None:
|
||||
self.game_unloaded = True
|
||||
|
||||
Reference in New Issue
Block a user