Move unit delivery ownership out of the UI.

Breaks save compat, but we need to have this knowledge outside the UI so
we can know whether or not we can ferry aircraft to the airfield without
overflowing parking.
This commit is contained in:
Dan Albert
2020-11-20 18:04:27 -08:00
parent 20091292f4
commit f8b2dbe283
6 changed files with 31 additions and 46 deletions

View File

@@ -33,6 +33,7 @@ from .theatergroundobject import (
if TYPE_CHECKING:
from game import Game
from gen.flights.flight import FlightType
from ..event import UnitsDeliveryEvent
class ControlPointType(Enum):
@@ -158,6 +159,7 @@ class ControlPoint(MissionTarget):
self.cptype = cptype
self.stances: Dict[int, CombatStance] = {}
self.airport = None
self.pending_unit_deliveries: Optional[UnitsDeliveryEvent] = None
@property
def ground_objects(self) -> List[TheaterGroundObject]:
@@ -387,3 +389,7 @@ class OffMapSpawn(ControlPoint):
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
yield from []
@property
def available_aircraft_slots(self) -> int:
return 1000