Dan Albert 7fe73ad2eb Fix description of dead flights.
Completed is technically correct but not very helpful.
2022-03-07 23:39:43 -08:00

47 lines
1.1 KiB
Python

from __future__ import annotations
from datetime import datetime, timedelta
from typing import TYPE_CHECKING
from dcs import Point
from game.settings import Settings
from .flightstate import FlightState
from ..starttype import StartType
if TYPE_CHECKING:
from .. import Flight
from game.sim.gameupdateevents import GameUpdateEvents
class Killed(FlightState):
def __init__(
self, last_position: Point, flight: Flight, settings: Settings
) -> None:
super().__init__(flight, settings)
self.last_position = last_position
@property
def alive(self) -> bool:
return False
def on_game_tick(
self, events: GameUpdateEvents, time: datetime, duration: timedelta
) -> None:
return
@property
def is_waiting_for_start(self) -> bool:
return False
def estimate_position(self) -> Point:
return self.last_position
@property
def spawn_type(self) -> StartType:
raise RuntimeError("Attempted to spawn a dead flight")
@property
def description(self) -> str:
return "KIA"