Clean up remaining Flight.from_cp users.

The preferred API for this has been `Flight.departure` for a while.
This commit is contained in:
Dan Albert
2023-06-29 20:24:24 -07:00
parent de8d42e3e5
commit b549af9cb7
9 changed files with 7 additions and 11 deletions

View File

View File

@@ -149,10 +149,6 @@ class Flight(SidcDescribable):
def is_helo(self) -> bool:
return self.unit_type.dcs_unit_type.helicopter
@property
def from_cp(self) -> ControlPoint:
return self.departure
@property
def points(self) -> List[FlightWaypoint]:
return self.flight_plan.waypoints[1:]

View File

@@ -283,7 +283,7 @@ class FlightPlan(ABC, Generic[LayoutT]):
def estimate_ground_ops(self) -> timedelta:
if self.flight.start_type in {StartType.RUNWAY, StartType.IN_FLIGHT}:
return timedelta()
if self.flight.from_cp.is_fleet:
if self.flight.departure.is_fleet:
return timedelta(minutes=2)
else:
return timedelta(minutes=8)

View File

@@ -110,7 +110,7 @@ class FlightGroupConfigurator:
flight_type=self.flight.flight_type,
units=self.group.units,
size=len(self.group.units),
friendly=self.flight.from_cp.captured,
friendly=self.flight.departure.captured,
departure_delay=mission_start_time,
departure=self.flight.departure.active_runway(
self.game.theater, self.game.conditions, self.dynamic_runways

View File

@@ -286,7 +286,7 @@ class WaypointGenerator:
# hot aircraft hours before their takeoff time.
return True
if self.flight.from_cp.is_fleet:
if self.flight.departure.is_fleet:
# Carrier spawns will crowd the carrier deck, especially without
# super carrier.
# TODO: Is there enough parking on the supercarrier?