From e541111a2731e066279e71bb4ab8a6a2041e5403 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 20 Nov 2022 16:29:19 +0100 Subject: [PATCH] Remove obsolete files --- game/commander/tasks/primitive/airassault.py | 35 ------------------- .../aircraft/waypoints/stopover.py | 14 -------- 2 files changed, 49 deletions(-) delete mode 100644 game/commander/tasks/primitive/airassault.py delete mode 100644 game/missiongenerator/aircraft/waypoints/stopover.py diff --git a/game/commander/tasks/primitive/airassault.py b/game/commander/tasks/primitive/airassault.py deleted file mode 100644 index 82704b23..00000000 --- a/game/commander/tasks/primitive/airassault.py +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass -from random import randint - -from game.ato.flighttype import FlightType -from game.commander.tasks.packageplanningtask import PackagePlanningTask -from game.commander.theaterstate import TheaterState -from game.theater import ControlPoint - - -@dataclass -class PlanAirAssault(PackagePlanningTask[ControlPoint]): - def preconditions_met(self, state: TheaterState) -> bool: - if self.target not in state.air_assault_targets: - return False - if self.capture_blocked(state): - # Do not task if there are enemy battle_positions blocking the capture - return False - if not self.target_area_preconditions_met(state): - # Do not task if air defense is present in the target area - return False - return super().preconditions_met(state) - - def capture_blocked(self, state: TheaterState) -> bool: - battle_positions = state.enemy_battle_positions[self.target] - return len(battle_positions.blocking_capture) > 0 - - def apply_effects(self, state: TheaterState) -> None: - state.air_assault_targets.remove(self.target) - - def propose_flights(self) -> None: - self.propose_flight(FlightType.AIR_ASSAULT, randint(2, 4)) - # TODO Validate this.. / is Heli escort possible? - self.propose_flight(FlightType.TARCAP, 2) diff --git a/game/missiongenerator/aircraft/waypoints/stopover.py b/game/missiongenerator/aircraft/waypoints/stopover.py deleted file mode 100644 index 69732cb4..00000000 --- a/game/missiongenerator/aircraft/waypoints/stopover.py +++ /dev/null @@ -1,14 +0,0 @@ -from dcs.point import MovingPoint, PointAction - -from .pydcswaypointbuilder import PydcsWaypointBuilder - - -class StopoverBuilder(PydcsWaypointBuilder): - def build(self) -> MovingPoint: - waypoint = super().build() - waypoint.type = "LandingReFuAr" - waypoint.action = PointAction.LandingReFuAr - waypoint.landing_refuel_rearm_time = 2 # Minutes. - if (control_point := self.waypoint.control_point) is not None: - waypoint.airdrome_id = control_point.airdrome_id_for_landing - return waypoint