Draw frozen combat on the map.

Very basic display. Draws the engagement footprint for air-to-air
combat, a line from the flight to the target for IP, and lines from SAMs
to their target for air defense.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
This commit is contained in:
Dan Albert
2021-12-21 14:06:04 -08:00
parent fb10a8d28e
commit 515efd0598
11 changed files with 268 additions and 11 deletions

View File

@@ -18,14 +18,16 @@ from game.ato.flightstate import (
from game.ato.starttype import StartType
from gen.flights.traveltime import TotEstimator
from .combat import CombatInitiator, FrozenCombat
from .gameupdatecallbacks import GameUpdateCallbacks
if TYPE_CHECKING:
from game import Game
class AircraftSimulation:
def __init__(self, game: Game) -> None:
def __init__(self, game: Game, callbacks: GameUpdateCallbacks) -> None:
self.game = game
self.callbacks = callbacks
self.combats: list[FrozenCombat] = []
def begin_simulation(self) -> None:
@@ -38,7 +40,7 @@ class AircraftSimulation:
# Finish updating all flights before checking for combat so that the new
# positions are used.
CombatInitiator(self.game, self.combats).update_active_combats()
CombatInitiator(self.game, self.combats, self.callbacks).update_active_combats()
# After updating all combat states, check for halts.
for flight in self.iter_flights():