mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
@@ -276,3 +276,15 @@ class Flight(SidcDescribable):
|
||||
|
||||
self._flight_plan_builder.regenerate()
|
||||
EventStream.put_nowait(GameUpdateEvents().update_flight(self))
|
||||
|
||||
@staticmethod
|
||||
def clone_flight(flight: Flight) -> Flight:
|
||||
return Flight(
|
||||
flight.package,
|
||||
flight.country,
|
||||
flight.squadron,
|
||||
flight.count,
|
||||
flight.flight_type,
|
||||
flight.start_type,
|
||||
flight.divert,
|
||||
)
|
||||
|
||||
@@ -214,3 +214,12 @@ class Package:
|
||||
if flight.departure == airfield:
|
||||
return airfield
|
||||
raise RuntimeError("Could not find any airfield assigned to this package")
|
||||
|
||||
@staticmethod
|
||||
def clone_package(package: Package) -> Package:
|
||||
clone = Package(package.target, package._db, package.auto_asap)
|
||||
clone.time_over_target = package.time_over_target
|
||||
for f in package.flights:
|
||||
cf = Flight.clone_flight(f)
|
||||
clone.add_flight(cf)
|
||||
return clone
|
||||
|
||||
Reference in New Issue
Block a user