mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Simplify IBuilder constructor.
We have access to the theater via the flight's departure airbase now.
This commit is contained in:
parent
4521053804
commit
7a45391c22
@ -194,9 +194,7 @@ class Flight(SidcDescribable):
|
||||
def abort(self) -> None:
|
||||
from .flightplans.rtb import RtbFlightPlan
|
||||
|
||||
self.flight_plan = RtbFlightPlan.builder_type()(
|
||||
self, self.coalition.game.theater
|
||||
).build()
|
||||
self.flight_plan = RtbFlightPlan.builder_type()(self).build()
|
||||
|
||||
self.set_state(
|
||||
Navigating(
|
||||
|
||||
@ -108,4 +108,4 @@ class FlightPlanBuilder:
|
||||
) from ex
|
||||
|
||||
def generate_flight_plan(self, flight: Flight) -> FlightPlan[Any]:
|
||||
return self.builder_type(flight)(flight, self.theater).build()
|
||||
return self.builder_type(flight)(flight).build()
|
||||
|
||||
@ -19,9 +19,12 @@ LayoutT = TypeVar("LayoutT", bound=Layout)
|
||||
|
||||
|
||||
class IBuilder(ABC, Generic[FlightPlanT, LayoutT]):
|
||||
def __init__(self, flight: Flight, theater: ConflictTheater) -> None:
|
||||
def __init__(self, flight: Flight) -> None:
|
||||
self.flight = flight
|
||||
self.theater = theater
|
||||
|
||||
@property
|
||||
def theater(self) -> ConflictTheater:
|
||||
return self.flight.departure.theater
|
||||
|
||||
@abstractmethod
|
||||
def layout(self) -> LayoutT:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user