mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Follow-up on flight TOT offset
This commit is contained in:
@@ -44,7 +44,7 @@ class CustomFlightPlan(FlightPlan[CustomLayout]):
|
||||
|
||||
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
if waypoint == self.tot_waypoint:
|
||||
return self.package.time_over_target
|
||||
return self.package.time_over_target + self.tot_offset
|
||||
return None
|
||||
|
||||
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
|
||||
@@ -21,7 +21,6 @@ from .planningerror import PlanningError
|
||||
from ..flightwaypointtype import FlightWaypointType
|
||||
from ..starttype import StartType
|
||||
from ..traveltime import GroundSpeed, TravelTime
|
||||
from ...savecompat import has_save_compat_for
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game.dcs.aircrafttype import FuelConsumption
|
||||
@@ -68,7 +67,6 @@ class FlightPlan(ABC, Generic[LayoutT]):
|
||||
self.layout = layout
|
||||
self.tot_offset = self.default_tot_offset()
|
||||
|
||||
@has_save_compat_for(7)
|
||||
def __setstate__(self, state: dict[str, Any]) -> None:
|
||||
if "tot_offset" not in state:
|
||||
state["tot_offset"] = self.default_tot_offset()
|
||||
|
||||
@@ -97,9 +97,9 @@ class FormationFlightPlan(LoiterFlightPlan, ABC):
|
||||
|
||||
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
if waypoint == self.layout.join:
|
||||
return self.join_time
|
||||
return self.join_time + self.tot_offset
|
||||
elif waypoint == self.layout.split:
|
||||
return self.split_time
|
||||
return self.split_time + self.tot_offset
|
||||
return None
|
||||
|
||||
@property
|
||||
|
||||
@@ -30,7 +30,7 @@ class LoiterFlightPlan(StandardFlightPlan[Any], ABC):
|
||||
|
||||
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
if waypoint == self.layout.hold:
|
||||
return self.push_time
|
||||
return self.push_time + self.tot_offset
|
||||
return None
|
||||
|
||||
def travel_time_between_waypoints(
|
||||
|
||||
@@ -73,7 +73,7 @@ class PatrollingFlightPlan(StandardFlightPlan[LayoutT], UiZoneDisplay, ABC):
|
||||
|
||||
@property
|
||||
def patrol_start_time(self) -> timedelta:
|
||||
return self.package.time_over_target
|
||||
return self.package.time_over_target + self.tot_offset
|
||||
|
||||
@property
|
||||
def patrol_end_time(self) -> timedelta:
|
||||
|
||||
@@ -66,14 +66,14 @@ class SweepFlightPlan(LoiterFlightPlan):
|
||||
|
||||
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
if waypoint == self.layout.sweep_start:
|
||||
return self.sweep_start_time
|
||||
return self.sweep_start_time + self.tot_offset
|
||||
if waypoint == self.layout.sweep_end:
|
||||
return self.sweep_end_time
|
||||
return self.sweep_end_time + self.tot_offset
|
||||
return None
|
||||
|
||||
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> timedelta | None:
|
||||
if waypoint == self.layout.hold:
|
||||
return self.push_time
|
||||
return self.push_time + self.tot_offset
|
||||
return None
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user