Dan Albert 769fe12159 Split flight plan layout into a separate class.
During package planning we don't care about the details of the flight
plan, just the layout (to check if the layout is threatened and we need
escorts). Splitting these will allow us to reduce the amount of work
that must be done in each loop of the planning phase, potentially
caching attempted flight plans between loops.
2022-03-11 16:00:48 -08:00

31 lines
775 B
Python

from __future__ import annotations
from datetime import timedelta
from typing import Type
from .formationattack import (
FormationAttackBuilder,
FormationAttackFlightPlan,
FormationAttackLayout,
)
from .. import Flight
from ..flightwaypointtype import FlightWaypointType
class SeadFlightPlan(FormationAttackFlightPlan):
def __init__(self, flight: Flight, layout: FormationAttackLayout) -> None:
super().__init__(flight, layout)
@staticmethod
def builder_type() -> Type[Builder]:
return Builder
@property
def lead_time(self) -> timedelta:
return timedelta(minutes=1)
class Builder(FormationAttackBuilder):
def build(self) -> FormationAttackLayout:
return self._build(FlightWaypointType.INGRESS_SEAD)