mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
refactor of previous commits
refactor to enum typing and many other fixes fix tests attempt to fix some typescript more typescript fixes more typescript test fixes revert all API changes update to pydcs mypy fixes Use properties to check if player is blue/red/neutral update requirements.txt black -_- bump pydcs and fix mypy add opponent property bump pydcs
This commit is contained in:
@@ -14,12 +14,13 @@ from ..utils import Distance
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game.game import Game
|
||||
from game.theater.player import Player
|
||||
from ..ato.flighttype import FlightType
|
||||
from .squadron import Squadron
|
||||
|
||||
|
||||
class AirWing:
|
||||
def __init__(self, player: bool, game: Game, faction: Faction) -> None:
|
||||
def __init__(self, player: Player, game: Game, faction: Faction) -> None:
|
||||
self.player = player
|
||||
self.squadrons: dict[AircraftType, list[Squadron]] = defaultdict(list)
|
||||
self.squadron_defs = SquadronDefLoader(game, faction).load()
|
||||
|
||||
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
|
||||
from game import Game
|
||||
from game.coalition import Coalition
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
from game.theater import ControlPoint, MissionTarget
|
||||
from game.theater import ControlPoint, MissionTarget, Player
|
||||
from .operatingbases import OperatingBases
|
||||
from .squadrondef import SquadronDef
|
||||
|
||||
@@ -96,7 +96,7 @@ class Squadron:
|
||||
self._livery_pool: list[str] = []
|
||||
|
||||
@property
|
||||
def player(self) -> bool:
|
||||
def player(self) -> Player:
|
||||
return self.coalition.player
|
||||
|
||||
def assign_to_base(self, base: ControlPoint) -> None:
|
||||
@@ -134,7 +134,7 @@ class Squadron:
|
||||
return self.claim_new_pilot_if_allowed()
|
||||
|
||||
# For opfor, so player/AI option is irrelevant.
|
||||
if not self.player:
|
||||
if self.player != Player.BLUE:
|
||||
return self.available_pilots.pop()
|
||||
|
||||
preference = self.settings.auto_ato_behavior
|
||||
|
||||
Reference in New Issue
Block a user