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.
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from game.coalition import Coalition
|
|
from game.data.doctrine import Doctrine
|
|
from game.theater import ConflictTheater
|
|
from game.threatzones import ThreatZones
|
|
from ..flight import Flight
|
|
from ..package import Package
|
|
from .flightplan import FlightPlan
|
|
|
|
|
|
class IBuilder(ABC):
|
|
def __init__(self, flight: Flight, theater: ConflictTheater) -> None:
|
|
self.flight = flight
|
|
self.theater = theater
|
|
|
|
@abstractmethod
|
|
def build(self) -> FlightPlan:
|
|
...
|
|
|
|
@property
|
|
def package(self) -> Package:
|
|
return self.flight.package
|
|
|
|
@property
|
|
def coalition(self) -> Coalition:
|
|
return self.flight.coalition
|
|
|
|
@property
|
|
def is_player(self) -> bool:
|
|
return self.coalition.player
|
|
|
|
@property
|
|
def doctrine(self) -> Doctrine:
|
|
return self.coalition.doctrine
|
|
|
|
@property
|
|
def threat_zones(self) -> ThreatZones:
|
|
return self.coalition.opponent.threat_zone
|