Move calculation of aircraft amounts into game.

The planner needs to know how much space is still expected to be
available next turn.
This commit is contained in:
Dan Albert
2020-11-20 18:25:03 -08:00
parent f8b2dbe283
commit c4b8a41742
7 changed files with 44 additions and 48 deletions

View File

@@ -376,6 +376,15 @@ class ControlPoint(MissionTarget):
return False
return True
@property
def expected_aircraft_next_turn(self) -> int:
total = self.base.total_aircraft
assert self.pending_unit_deliveries
for unit_bought in self.pending_unit_deliveries.units:
if issubclass(unit_bought, FlyingType):
total += self.pending_unit_deliveries.units[unit_bought]
return total
class OffMapSpawn(ControlPoint):
def __init__(self, id: int, name: str, position: Point):