mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Refactor & fix code after comments
This commit is contained in:
parent
e00951e5b9
commit
1b9ac088e4
@ -1133,7 +1133,7 @@ class Fob(ControlPoint):
|
|||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def runway_is_operational(self) -> bool:
|
def runway_is_operational(self) -> bool:
|
||||||
return False
|
return self.has_helipads
|
||||||
|
|
||||||
def active_runway(
|
def active_runway(
|
||||||
self, conditions: Conditions, dynamic_runways: Dict[str, RunwayData]
|
self, conditions: Conditions, dynamic_runways: Dict[str, RunwayData]
|
||||||
|
|||||||
@ -1197,7 +1197,7 @@ class AircraftConflictGenerator:
|
|||||||
|
|
||||||
# If the flight is an helicopter flight, then prioritize dedicated helipads
|
# If the flight is an helicopter flight, then prioritize dedicated helipads
|
||||||
group = None
|
group = None
|
||||||
if flight.unit_type in helicopters.helicopter_map.values():
|
if flight.unit_type.helicopter:
|
||||||
helipad = cp.get_free_helipad()
|
helipad = cp.get_free_helipad()
|
||||||
if helipad is not None:
|
if helipad is not None:
|
||||||
group = self._generate_at_group(
|
group = self._generate_at_group(
|
||||||
|
|||||||
@ -25,11 +25,7 @@ class ClosestAirfields:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def operational_airfields(self) -> Iterator[ControlPoint]:
|
def operational_airfields(self) -> Iterator[ControlPoint]:
|
||||||
return (
|
return (c for c in self.closest_airfields if c.runway_is_operational())
|
||||||
c
|
|
||||||
for c in self.closest_airfields
|
|
||||||
if c.runway_is_operational() or c.has_helipads
|
|
||||||
)
|
|
||||||
|
|
||||||
def _airfields_within(
|
def _airfields_within(
|
||||||
self, distance: Distance, operational: bool
|
self, distance: Distance, operational: bool
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user