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
committed by Raffson
parent 5e858731d2
commit f89ac52bf3
9 changed files with 8 additions and 12 deletions

View File

View File

@@ -188,10 +188,6 @@ class Flight(SidcDescribable, RadioFrequencyContainer, TacanContainer):
def is_hercules(self) -> bool:
return self.unit_type == AircraftType.named("C-130J-30 Super Hercules")
@property
def from_cp(self) -> ControlPoint:
return self.departure
@property
def points(self) -> List[FlightWaypoint]:
return self.flight_plan.waypoints[1:]

View File

@@ -291,7 +291,7 @@ class FlightPlan(ABC, Generic[LayoutT]):
# This is a workaround to a DCS problem: some AI planes spawn on
# the 'sixpack' when start_time is zero and cause a deadlock.
# Workaround: force the start_time to 1 second for these planes.
if self.flight.from_cp.is_fleet and start_time.total_seconds() == 0:
if self.flight.departure.is_fleet and start_time.total_seconds() == 0:
start_time = timedelta(seconds=1)
return start_time
@@ -308,7 +308,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 or self.flight.from_cp.is_fob:
if self.flight.departure.is_fleet or self.flight.departure.is_fob:
return timedelta(minutes=2)
else:
return timedelta(minutes=8)

View File

@@ -125,7 +125,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

@@ -263,7 +263,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?