mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Split the oversized file into one per plan type. This also moves the layout responsibility out of the oversized FlightPlanBuilder and into each flight plan type file.
23 lines
750 B
Python
23 lines
750 B
Python
import logging
|
|
|
|
from dcs.point import MovingPoint
|
|
|
|
from game.ato.flightplans.patrolling import PatrollingFlightPlan
|
|
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|
|
|
|
|
class RaceTrackEndBuilder(PydcsWaypointBuilder):
|
|
def build(self) -> MovingPoint:
|
|
waypoint = super().build()
|
|
|
|
if not isinstance(self.flight.flight_plan, PatrollingFlightPlan):
|
|
flight_plan_type = self.flight.flight_plan.__class__.__name__
|
|
logging.error(
|
|
f"Cannot create race track for {self.flight} because "
|
|
f"{flight_plan_type} does not define a patrol."
|
|
)
|
|
return waypoint
|
|
|
|
self.waypoint.departure_time = self.flight.flight_plan.patrol_end_time
|
|
return waypoint
|