mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Aims to solve the issue where AirAssault won't plan against CPs that don't have an active frontline, including isolated CPs.
17 lines
640 B
Python
17 lines
640 B
Python
from collections.abc import Iterator
|
|
from dataclasses import dataclass
|
|
|
|
from game.commander.tasks.compound.capturebase import CaptureBase
|
|
from game.commander.tasks.primitive.airassault import PlanAirAssault
|
|
from game.commander.theaterstate import TheaterState
|
|
from game.htn import CompoundTask, Method
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CaptureBases(CompoundTask[TheaterState]):
|
|
def each_valid_method(self, state: TheaterState) -> Iterator[Method[TheaterState]]:
|
|
for front in state.active_front_lines:
|
|
yield [CaptureBase(front)]
|
|
for cp in state.vulnerable_control_points:
|
|
yield [PlanAirAssault(cp)]
|