Recovery tanker support (#429)

* fix conflict

* squash bugs and reuse patrol layout

* fix tanker tacan and formatting

* fix unlimited fuel option

* update pretense for tanker changes

* reuse refueling flight plan and bugfix for sunken carrier

changelog

* remove unitmap dependency

* formatting and more unit map removal

* more formatting

* typing and black

* keep tanker out of clouds

* fix if there are no clouds

* better cloud handling

* groundwork for recovery task

* remove changes to game/commander

* Finishing up recovery tankers

---------

Co-authored-by: Raffson <Raffson@users.noreply.github.com>
This commit is contained in:
Druss99
2024-12-22 23:39:10 -05:00
committed by GitHub
parent a4671571bc
commit dd7e4c908e
46 changed files with 395 additions and 25 deletions

View File

@@ -40,6 +40,8 @@ class MissionScheduler:
p for p in self.coalition.ato.packages if p.primary_task not in dca_types
]
carrier_etas = []
start_time = start_time_generator(
count=len(non_dca_packages),
earliest=5 * 60,
@@ -47,6 +49,8 @@ class MissionScheduler:
margin=5 * 60,
)
for package in self.coalition.ato.packages:
if package.primary_task is FlightType.RECOVERY:
continue
tot = TotEstimator(package).earliest_tot(now)
if package.primary_task in dca_types:
previous_end_time = previous_cap_end_time[package.target]
@@ -74,3 +78,19 @@ class MissionScheduler:
# to be present. Runway and air started aircraft will be
# delayed until their takeoff time by AirConflictGenerator.
package.time_over_target = next(start_time) + tot
arrivals = []
for f in package.flights:
if f.departure.is_fleet and not f.is_helo:
arrivals.append(f.flight_plan.landing_time - timedelta(minutes=10))
if arrivals:
carrier_etas.append(min(arrivals))
for package in [
p
for p in self.coalition.ato.packages
if p.primary_task is FlightType.RECOVERY
]:
if carrier_etas:
package.time_over_target = carrier_etas.pop(0)
else:
break