Move NavMesh out of MapModel.

This commit is contained in:
Dan Albert
2022-02-22 18:47:51 -08:00
parent 1a9930b93a
commit 0e6a303c17
15 changed files with 108 additions and 127 deletions

View File

@@ -1,6 +1,6 @@
from asyncio import Queue
from game.sim.gameupdateevents import GameUpdateEvents
from game.sim import GameUpdateEvents
class EventStream:

View File

@@ -10,13 +10,14 @@ from game.server.leaflet import LeafletLatLon
if TYPE_CHECKING:
from game import Game
from game.sim.gameupdateevents import GameUpdateEvents
from game.sim import GameUpdateEvents
class GameUpdateEventsJs(BaseModel):
updated_flights: dict[UUID, LeafletLatLon]
new_combats: list[FrozenCombatJs] = []
updated_combats: list[FrozenCombatJs] = []
navmesh_updates: set[bool] = set()
@classmethod
def from_events(cls, events: GameUpdateEvents, game: Game) -> GameUpdateEventsJs:
@@ -31,4 +32,5 @@ class GameUpdateEventsJs(BaseModel):
FrozenCombatJs.for_combat(c, game.theater)
for c in events.updated_combats
],
navmesh_updates=events.navmesh_updates,
)