mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Move squadron end-turn behavior into the squadron.
This commit is contained in:
parent
469b1e5efe
commit
8fea8e7b47
@ -139,7 +139,7 @@ class Coalition:
|
|||||||
For more information on turn finalization in general, see the documentation for
|
For more information on turn finalization in general, see the documentation for
|
||||||
`Game.finish_turn`.
|
`Game.finish_turn`.
|
||||||
"""
|
"""
|
||||||
self.air_wing.replenish()
|
self.air_wing.end_turn()
|
||||||
self.budget += Income(self.game, self.player).total
|
self.budget += Income(self.game, self.player).total
|
||||||
|
|
||||||
# Need to recompute before transfers and deliveries to account for captures.
|
# Need to recompute before transfers and deliveries to account for captures.
|
||||||
|
|||||||
@ -75,9 +75,9 @@ class AirWing:
|
|||||||
for squadron in self.iter_squadrons():
|
for squadron in self.iter_squadrons():
|
||||||
squadron.populate_for_turn_0()
|
squadron.populate_for_turn_0()
|
||||||
|
|
||||||
def replenish(self) -> None:
|
def end_turn(self) -> None:
|
||||||
for squadron in self.iter_squadrons():
|
for squadron in self.iter_squadrons():
|
||||||
squadron.replenish_lost_pilots()
|
squadron.end_turn()
|
||||||
|
|
||||||
def reset(self) -> None:
|
def reset(self) -> None:
|
||||||
for squadron in self.iter_squadrons():
|
for squadron in self.iter_squadrons():
|
||||||
|
|||||||
@ -167,6 +167,10 @@ class Squadron:
|
|||||||
raise ValueError("Squadrons can only be created with active pilots.")
|
raise ValueError("Squadrons can only be created with active pilots.")
|
||||||
self._recruit_pilots(self.settings.squadron_pilot_limit)
|
self._recruit_pilots(self.settings.squadron_pilot_limit)
|
||||||
|
|
||||||
|
def end_turn(self) -> None:
|
||||||
|
self.replenish_lost_pilots()
|
||||||
|
self.deliver_orders()
|
||||||
|
|
||||||
def replenish_lost_pilots(self) -> None:
|
def replenish_lost_pilots(self) -> None:
|
||||||
if not self.pilot_limits_enabled:
|
if not self.pilot_limits_enabled:
|
||||||
return
|
return
|
||||||
|
|||||||
@ -704,8 +704,6 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
|
|
||||||
def process_turn(self, game: Game) -> None:
|
def process_turn(self, game: Game) -> None:
|
||||||
self.ground_unit_orders.process(game)
|
self.ground_unit_orders.process(game)
|
||||||
for squadron in self.squadrons:
|
|
||||||
squadron.deliver_orders()
|
|
||||||
|
|
||||||
runway_status = self.runway_status
|
runway_status = self.runway_status
|
||||||
if runway_status is not None:
|
if runway_status is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user