Check for available aircraft as task precondition.

This makes it so that the mission planning effects are applied only if
the package can be fulfilled. For example, breakthrough will be used
only if all the BAI missions were fulfilled, not if they will *attempt*
to be fulfilled.
This commit is contained in:
Dan Albert
2021-07-13 14:25:30 -07:00
parent 24f6aff8c8
commit ccf6b6ef5f
17 changed files with 578 additions and 597 deletions

View File

@@ -5,16 +5,12 @@ from typing import TYPE_CHECKING
from game.commander.theaterstate import TheaterState
from game.htn import PrimitiveTask
from game.profiling import MultiEventTracer
if TYPE_CHECKING:
from gen.flights.ai_flight_planner import CoalitionMissionPlanner
from game.coalition import Coalition
# TODO: Refactor so that we don't need to call up to the mission planner.
class TheaterCommanderTask(PrimitiveTask[TheaterState]):
@abstractmethod
def execute(
self, mission_planner: CoalitionMissionPlanner, tracer: MultiEventTracer
) -> None:
def execute(self, coalition: Coalition) -> None:
...