Refactor & fix code after comments

This commit is contained in:
Khopa 2021-06-10 13:19:22 +02:00
parent e00951e5b9
commit 1b9ac088e4
3 changed files with 3 additions and 7 deletions

View File

@ -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]

View File

@ -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(

View File

@ -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