mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Refactor flight plan generation.
This commit is contained in:
@@ -5,6 +5,7 @@ from game.inventory import GlobalAircraftInventory
|
||||
from game.models.game_stats import GameStats
|
||||
from gen.ato import AirTaskingOrder
|
||||
from gen.flights.ai_flight_planner import CoalitionMissionPlanner
|
||||
from gen.flights.closestairfields import ObjectiveDistanceCache
|
||||
from gen.ground_forces.ai_ground_planner import GroundPlanner
|
||||
from .event import *
|
||||
from .settings import Settings
|
||||
@@ -204,6 +205,7 @@ class Game:
|
||||
return event and event.name and event.name == self.player_name
|
||||
|
||||
def pass_turn(self, no_action=False, ignored_cps: typing.Collection[ControlPoint] = None):
|
||||
ObjectiveDistanceCache.set_theater(self.theater)
|
||||
|
||||
logging.info("Pass turn")
|
||||
self.informations.append(Information("End of turn #" + str(self.turn), "-" * 40, 0))
|
||||
|
||||
@@ -185,20 +185,16 @@ class Operation:
|
||||
self.airsupportgen.generate(self.is_awacs_enabled)
|
||||
|
||||
# Generate Activity on the map
|
||||
for cp in self.game.theater.controlpoints:
|
||||
side = cp.captured
|
||||
if side:
|
||||
country = self.current_mission.country(self.game.player_country)
|
||||
ato = self.game.blue_ato
|
||||
else:
|
||||
country = self.current_mission.country(self.game.enemy_country)
|
||||
ato = self.game.red_ato
|
||||
self.airgen.generate_flights(
|
||||
cp,
|
||||
country,
|
||||
ato,
|
||||
self.groundobjectgen.runways
|
||||
)
|
||||
self.airgen.generate_flights(
|
||||
self.current_mission.country(self.game.player_country),
|
||||
self.game.blue_ato,
|
||||
self.groundobjectgen.runways
|
||||
)
|
||||
self.airgen.generate_flights(
|
||||
self.current_mission.country(self.game.enemy_country),
|
||||
self.game.red_ato,
|
||||
self.groundobjectgen.runways
|
||||
)
|
||||
|
||||
# Generate ground units on frontline everywhere
|
||||
jtacs: List[JtacInfo] = []
|
||||
|
||||
Reference in New Issue
Block a user