Move squadron end-turn behavior into the squadron.

This commit is contained in:
Dan Albert 2021-08-28 18:03:33 -07:00
parent 469b1e5efe
commit 8fea8e7b47
4 changed files with 7 additions and 5 deletions

View File

@ -139,7 +139,7 @@ class Coalition:
For more information on turn finalization in general, see the documentation for
`Game.finish_turn`.
"""
self.air_wing.replenish()
self.air_wing.end_turn()
self.budget += Income(self.game, self.player).total
# Need to recompute before transfers and deliveries to account for captures.

View File

@ -75,9 +75,9 @@ class AirWing:
for squadron in self.iter_squadrons():
squadron.populate_for_turn_0()
def replenish(self) -> None:
def end_turn(self) -> None:
for squadron in self.iter_squadrons():
squadron.replenish_lost_pilots()
squadron.end_turn()
def reset(self) -> None:
for squadron in self.iter_squadrons():

View File

@ -167,6 +167,10 @@ class Squadron:
raise ValueError("Squadrons can only be created with active pilots.")
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:
if not self.pilot_limits_enabled:
return

View File

@ -704,8 +704,6 @@ class ControlPoint(MissionTarget, ABC):
def process_turn(self, game: Game) -> None:
self.ground_unit_orders.process(game)
for squadron in self.squadrons:
squadron.deliver_orders()
runway_status = self.runway_status
if runway_status is not None: