mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Reformat code with upgraded version of black (#3446)
This commit is contained in:
parent
b008305275
commit
0e9a8ac1a1
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: psf/black@stable
|
||||
with:
|
||||
version: ~=23.11
|
||||
version: ~=24.3.0
|
||||
src: "."
|
||||
options: "--check"
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Objective adjacency lists."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, Iterator, List, Optional, TYPE_CHECKING
|
||||
|
||||
@ -5,6 +5,7 @@ MissionPlanner. Those only plan basic information like the objective, aircraft
|
||||
type, and the size of the flight. The FlightPlanBuilder is responsible for
|
||||
generating the waypoints for the mission.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
|
||||
@ -30,8 +30,7 @@ LayoutT = TypeVar("LayoutT", bound=FormationLayout)
|
||||
class FormationFlightPlan(LoiterFlightPlan[LayoutT], ABC):
|
||||
@property
|
||||
@abstractmethod
|
||||
def package_speed_waypoints(self) -> set[FlightWaypoint]:
|
||||
...
|
||||
def package_speed_waypoints(self) -> set[FlightWaypoint]: ...
|
||||
|
||||
@property
|
||||
def combat_speed_waypoints(self) -> set[FlightWaypoint]:
|
||||
@ -69,13 +68,11 @@ class FormationFlightPlan(LoiterFlightPlan[LayoutT], ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def join_time(self) -> datetime:
|
||||
...
|
||||
def join_time(self) -> datetime: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def split_time(self) -> datetime:
|
||||
...
|
||||
def split_time(self) -> datetime: ...
|
||||
|
||||
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
|
||||
if waypoint == self.layout.join:
|
||||
|
||||
@ -60,8 +60,7 @@ class IBuilder(ABC, Generic[FlightPlanT, LayoutT]):
|
||||
return self.flight.departure.theater
|
||||
|
||||
@abstractmethod
|
||||
def build(self, dump_debug_info: bool = False) -> FlightPlanT:
|
||||
...
|
||||
def build(self, dump_debug_info: bool = False) -> FlightPlanT: ...
|
||||
|
||||
@property
|
||||
def package(self) -> Package:
|
||||
|
||||
@ -30,8 +30,7 @@ class LoiterFlightPlan(StandardFlightPlan[LayoutT], ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def push_time(self) -> datetime:
|
||||
...
|
||||
def push_time(self) -> datetime: ...
|
||||
|
||||
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
|
||||
if waypoint == self.layout.hold:
|
||||
|
||||
@ -14,5 +14,4 @@ class UiZone:
|
||||
|
||||
class UiZoneDisplay(abc.ABC):
|
||||
@abc.abstractmethod
|
||||
def ui_zone(self) -> UiZone:
|
||||
...
|
||||
def ui_zone(self) -> UiZone: ...
|
||||
|
||||
@ -57,14 +57,12 @@ class FlightState(ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def cancelable(self) -> bool:
|
||||
...
|
||||
def cancelable(self) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def on_game_tick(
|
||||
self, events: GameUpdateEvents, time: datetime, duration: timedelta
|
||||
) -> None:
|
||||
...
|
||||
) -> None: ...
|
||||
|
||||
@property
|
||||
def in_flight(self) -> bool:
|
||||
@ -95,17 +93,14 @@ class FlightState(ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def is_waiting_for_start(self) -> bool:
|
||||
...
|
||||
def is_waiting_for_start(self) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def estimate_position(self) -> Point:
|
||||
...
|
||||
def estimate_position(self) -> Point: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def spawn_type(self) -> StartType:
|
||||
...
|
||||
def spawn_type(self) -> StartType: ...
|
||||
|
||||
def a2a_commit_region(self) -> Optional[ThreatPoly]:
|
||||
return None
|
||||
|
||||
@ -67,16 +67,13 @@ class InFlight(FlightState, ABC):
|
||||
)
|
||||
|
||||
@abstractmethod
|
||||
def estimate_position(self) -> Point:
|
||||
...
|
||||
def estimate_position(self) -> Point: ...
|
||||
|
||||
@abstractmethod
|
||||
def estimate_altitude(self) -> tuple[Distance, str]:
|
||||
...
|
||||
def estimate_altitude(self) -> tuple[Distance, str]: ...
|
||||
|
||||
@abstractmethod
|
||||
def estimate_speed(self) -> Speed:
|
||||
...
|
||||
def estimate_speed(self) -> Speed: ...
|
||||
|
||||
def estimate_fuel_at_current_waypoint(self) -> float:
|
||||
initial_fuel = super().estimate_fuel()
|
||||
|
||||
@ -9,26 +9,20 @@ if TYPE_CHECKING:
|
||||
|
||||
class IFlightRoster(ABC):
|
||||
@abstractmethod
|
||||
def iter_pilots(self) -> Iterator[Pilot | None]:
|
||||
...
|
||||
def iter_pilots(self) -> Iterator[Pilot | None]: ...
|
||||
|
||||
@abstractmethod
|
||||
def pilot_at(self, idx: int) -> Pilot | None:
|
||||
...
|
||||
def pilot_at(self, idx: int) -> Pilot | None: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def max_size(self) -> int:
|
||||
...
|
||||
def max_size(self) -> int: ...
|
||||
|
||||
@abstractmethod
|
||||
def resize(self, new_size: int) -> None:
|
||||
...
|
||||
def resize(self, new_size: int) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def set_pilot(self, index: int, pilot: Optional[Pilot]) -> None:
|
||||
...
|
||||
def set_pilot(self, index: int, pilot: Optional[Pilot]) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def clear(self) -> None:
|
||||
...
|
||||
def clear(self) -> None: ...
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Support for working with DCS group callsigns."""
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
@ -14,12 +14,10 @@ class FactionRecommendation(ABC):
|
||||
self.name = name
|
||||
|
||||
@abstractmethod
|
||||
def register_campaign_specific_faction(self, factions: Factions) -> None:
|
||||
...
|
||||
def register_campaign_specific_faction(self, factions: Factions) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def get_faction(self, factions: Factions) -> Faction:
|
||||
...
|
||||
def get_faction(self, factions: Factions) -> Faction: ...
|
||||
|
||||
@staticmethod
|
||||
def from_field(
|
||||
|
||||
@ -21,8 +21,7 @@ class FrontLineStanceTask(TheaterCommanderTask, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def stance(self) -> CombatStance:
|
||||
...
|
||||
def stance(self) -> CombatStance: ...
|
||||
|
||||
@staticmethod
|
||||
def management_allowed(state: TheaterState) -> bool:
|
||||
@ -49,8 +48,7 @@ class FrontLineStanceTask(TheaterCommanderTask, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def have_sufficient_front_line_advantage(self) -> bool:
|
||||
...
|
||||
def have_sufficient_front_line_advantage(self) -> bool: ...
|
||||
|
||||
@property
|
||||
def ground_force_balance(self) -> float:
|
||||
|
||||
@ -54,8 +54,7 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
coalition.ato.add_package(self.package)
|
||||
|
||||
@abstractmethod
|
||||
def propose_flights(self) -> None:
|
||||
...
|
||||
def propose_flights(self) -> None: ...
|
||||
|
||||
def propose_flight(
|
||||
self,
|
||||
@ -118,9 +117,9 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
target_ranges: list[
|
||||
tuple[Union[IadsGroundObject, NavalGroundObject], Distance]
|
||||
] = []
|
||||
all_iads: Iterator[
|
||||
Union[IadsGroundObject, NavalGroundObject]
|
||||
] = itertools.chain(state.enemy_air_defenses, state.enemy_ships)
|
||||
all_iads: Iterator[Union[IadsGroundObject, NavalGroundObject]] = (
|
||||
itertools.chain(state.enemy_air_defenses, state.enemy_ships)
|
||||
)
|
||||
for target in all_iads:
|
||||
distance = meters(target.distance_to(self.target))
|
||||
if range_type is RangeType.Detection:
|
||||
|
||||
@ -12,5 +12,4 @@ if TYPE_CHECKING:
|
||||
|
||||
class TheaterCommanderTask(PrimitiveTask[TheaterState]):
|
||||
@abstractmethod
|
||||
def execute(self, coalition: Coalition) -> None:
|
||||
...
|
||||
def execute(self, coalition: Coalition) -> None: ...
|
||||
|
||||
@ -52,6 +52,7 @@ even though it is a primitive task used by many other tasks.
|
||||
|
||||
https://en.wikipedia.org/wiki/Hierarchical_task_network
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
@ -60,9 +60,9 @@ class GroundUnitType(UnitType[Type[VehicleType]]):
|
||||
reversed_heading: bool = False
|
||||
|
||||
_by_name: ClassVar[dict[str, GroundUnitType]] = {}
|
||||
_by_unit_type: ClassVar[
|
||||
dict[type[VehicleType], list[GroundUnitType]]
|
||||
] = defaultdict(list)
|
||||
_by_unit_type: ClassVar[dict[type[VehicleType], list[GroundUnitType]]] = (
|
||||
defaultdict(list)
|
||||
)
|
||||
|
||||
def __setstate__(self, state: dict[str, Any]) -> None:
|
||||
# Update any existing models with new data on load.
|
||||
|
||||
@ -17,12 +17,10 @@ class LaserCodeConfig(ABC):
|
||||
)
|
||||
|
||||
@abstractmethod
|
||||
def iter_prop_ids(self) -> Iterator[str]:
|
||||
...
|
||||
def iter_prop_ids(self) -> Iterator[str]: ...
|
||||
|
||||
@abstractmethod
|
||||
def property_dict_for_code(self, code: int) -> dict[str, int]:
|
||||
...
|
||||
def property_dict_for_code(self, code: int) -> dict[str, int]: ...
|
||||
|
||||
|
||||
class SinglePropertyLaserCodeConfig(LaserCodeConfig):
|
||||
|
||||
@ -15,15 +15,12 @@ if TYPE_CHECKING:
|
||||
|
||||
class WaypointAction(ABC):
|
||||
@abstractmethod
|
||||
def describe(self) -> str:
|
||||
...
|
||||
def describe(self) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
def update_state(
|
||||
self, state: ActionState, time: datetime, duration: timedelta
|
||||
) -> timedelta:
|
||||
...
|
||||
) -> timedelta: ...
|
||||
|
||||
@abstractmethod
|
||||
def iter_tasks(self, ctx: TaskContext) -> Iterator[Task]:
|
||||
...
|
||||
def iter_tasks(self, ctx: TaskContext) -> Iterator[Task]: ...
|
||||
|
||||
@ -28,14 +28,12 @@ def point_at_heading(p: Point, heading: Heading, distance: Distance) -> Point:
|
||||
|
||||
class Prerequisite(ABC):
|
||||
@abstractmethod
|
||||
def is_satisfied(self) -> bool:
|
||||
...
|
||||
def is_satisfied(self) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def describe_debug_info(
|
||||
self, to_geojson: Callable[[BaseGeometry], dict[str, Any]]
|
||||
) -> dict[str, Any]:
|
||||
...
|
||||
) -> dict[str, Any]: ...
|
||||
|
||||
|
||||
class DistancePrerequisite(Prerequisite):
|
||||
|
||||
14
game/htn.py
14
game/htn.py
@ -11,8 +11,7 @@ WorldStateT = TypeVar("WorldStateT", bound="WorldState[Any]")
|
||||
|
||||
class WorldState(ABC, Generic[WorldStateT]):
|
||||
@abstractmethod
|
||||
def clone(self) -> WorldStateT:
|
||||
...
|
||||
def clone(self) -> WorldStateT: ...
|
||||
|
||||
|
||||
class Task(Generic[WorldStateT]):
|
||||
@ -24,18 +23,17 @@ Method = Sequence[Task[WorldStateT]]
|
||||
|
||||
class PrimitiveTask(Task[WorldStateT], Generic[WorldStateT], ABC):
|
||||
@abstractmethod
|
||||
def preconditions_met(self, state: WorldStateT) -> bool:
|
||||
...
|
||||
def preconditions_met(self, state: WorldStateT) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def apply_effects(self, state: WorldStateT) -> None:
|
||||
...
|
||||
def apply_effects(self, state: WorldStateT) -> None: ...
|
||||
|
||||
|
||||
class CompoundTask(Task[WorldStateT], Generic[WorldStateT], ABC):
|
||||
@abstractmethod
|
||||
def each_valid_method(self, state: WorldStateT) -> Iterator[Method[WorldStateT]]:
|
||||
...
|
||||
def each_valid_method(
|
||||
self, state: WorldStateT
|
||||
) -> Iterator[Method[WorldStateT]]: ...
|
||||
|
||||
|
||||
PrimitiveTaskT = TypeVar("PrimitiveTaskT", bound=PrimitiveTask[Any])
|
||||
|
||||
@ -10,9 +10,11 @@ class Information:
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "[{}][{}] {} {}".format(
|
||||
self.timestamp.strftime("%Y-%m-%d %H:%M:%S")
|
||||
if self.timestamp is not None
|
||||
else "",
|
||||
(
|
||||
self.timestamp.strftime("%Y-%m-%d %H:%M:%S")
|
||||
if self.timestamp is not None
|
||||
else ""
|
||||
),
|
||||
self.turn,
|
||||
self.title,
|
||||
self.text,
|
||||
|
||||
@ -9,9 +9,7 @@ if TYPE_CHECKING:
|
||||
|
||||
class ILaserCodeRegistry(ABC):
|
||||
@abstractmethod
|
||||
def alloc_laser_code(self) -> LaserCode:
|
||||
...
|
||||
def alloc_laser_code(self) -> LaserCode: ...
|
||||
|
||||
@abstractmethod
|
||||
def release_code(self, code: LaserCode) -> None:
|
||||
...
|
||||
def release_code(self, code: LaserCode) -> None: ...
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Logging APIs."""
|
||||
|
||||
import logging
|
||||
import logging.config
|
||||
import os
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""
|
||||
Briefing generation logic
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
@ -22,6 +22,7 @@ https://forums.eagle.ru/showthread.php?t=206360 claims that kneeboard pages can
|
||||
only be added per airframe, so PvP missions where each side have the same
|
||||
aircraft will be able to see the enemy's kneeboard for the same airframe.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import math
|
||||
import textwrap
|
||||
|
||||
@ -5,6 +5,7 @@ groups, statics, missile sites, and AA sites for the mission. Each of these
|
||||
objectives is defined in the Theater by a TheaterGroundObject. These classes
|
||||
create the pydcs groups and statics for those areas and add them to the mission.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
@ -48,12 +48,10 @@ class PurchaseAdapter(Generic[ItemType]):
|
||||
return self.pending_delivery_quantity(item) < 0
|
||||
|
||||
@abstractmethod
|
||||
def current_quantity_of(self, item: ItemType) -> int:
|
||||
...
|
||||
def current_quantity_of(self, item: ItemType) -> int: ...
|
||||
|
||||
@abstractmethod
|
||||
def pending_delivery_quantity(self, item: ItemType) -> int:
|
||||
...
|
||||
def pending_delivery_quantity(self, item: ItemType) -> int: ...
|
||||
|
||||
def expected_quantity_next_turn(self, item: ItemType) -> int:
|
||||
return self.current_quantity_of(item) + self.pending_delivery_quantity(item)
|
||||
@ -65,36 +63,28 @@ class PurchaseAdapter(Generic[ItemType]):
|
||||
return self.can_sell(item) or self.has_pending_orders(item)
|
||||
|
||||
@abstractmethod
|
||||
def can_sell(self, item: ItemType) -> bool:
|
||||
...
|
||||
def can_sell(self, item: ItemType) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def do_purchase(self, item: ItemType) -> None:
|
||||
...
|
||||
def do_purchase(self, item: ItemType) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def do_cancel_purchase(self, item: ItemType) -> None:
|
||||
...
|
||||
def do_cancel_purchase(self, item: ItemType) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def do_sale(self, item: ItemType) -> None:
|
||||
...
|
||||
def do_sale(self, item: ItemType) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def do_cancel_sale(self, item: ItemType) -> None:
|
||||
...
|
||||
def do_cancel_sale(self, item: ItemType) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def price_of(self, item: ItemType) -> int:
|
||||
...
|
||||
def price_of(self, item: ItemType) -> int: ...
|
||||
|
||||
@abstractmethod
|
||||
def name_of(self, item: ItemType, multiline: bool = False) -> str:
|
||||
...
|
||||
def name_of(self, item: ItemType, multiline: bool = False) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
def unit_type_of(self, item: ItemType) -> UnitType[Any]:
|
||||
...
|
||||
def unit_type_of(self, item: ItemType) -> UnitType[Any]: ...
|
||||
|
||||
|
||||
class AircraftPurchaseAdapter(PurchaseAdapter[Squadron]):
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""TACAN channel handling."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Runway information and selection."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tools for aiding in save compat removal after compatibility breaks."""
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import TypeVar
|
||||
|
||||
|
||||
10
game/sidc.py
10
game/sidc.py
@ -10,6 +10,7 @@ from the output.
|
||||
https://nso.nato.int/nso/nsdd/main/standards/ap-details/1912/EN
|
||||
https://www.spatialillusions.com/milsymbol/docs/milsymbol-APP6d.html
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
@ -330,18 +331,15 @@ class SymbolIdentificationCode:
|
||||
class SidcDescribable(ABC):
|
||||
@property
|
||||
@abstractmethod
|
||||
def standard_identity(self) -> StandardIdentity:
|
||||
...
|
||||
def standard_identity(self) -> StandardIdentity: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def sidc_status(self) -> Status:
|
||||
...
|
||||
def sidc_status(self) -> Status: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]:
|
||||
...
|
||||
def symbol_set_and_entity(self) -> tuple[SymbolSet, Entity]: ...
|
||||
|
||||
def sidc(self) -> SymbolIdentificationCode:
|
||||
symbol_set, entity = self.symbol_set_and_entity
|
||||
|
||||
@ -40,20 +40,16 @@ class FrozenCombat(ABC):
|
||||
events: GameUpdateEvents,
|
||||
time: datetime,
|
||||
elapsed_time: timedelta,
|
||||
) -> None:
|
||||
...
|
||||
) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def because(self) -> str:
|
||||
...
|
||||
def because(self) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
def describe(self) -> str:
|
||||
...
|
||||
def describe(self) -> str: ...
|
||||
|
||||
@abstractmethod
|
||||
def iter_flights(self) -> Iterator[Flight]:
|
||||
...
|
||||
def iter_flights(self) -> Iterator[Flight]: ...
|
||||
|
||||
def update_flight_states(self) -> None:
|
||||
for flight in self.iter_flights():
|
||||
|
||||
@ -18,8 +18,7 @@ class JoinableCombat(FrozenCombat, ABC):
|
||||
self.flights = flights
|
||||
|
||||
@abstractmethod
|
||||
def joinable_by(self, flight: Flight) -> bool:
|
||||
...
|
||||
def joinable_by(self, flight: Flight) -> bool: ...
|
||||
|
||||
def join(self, flight: Flight) -> None:
|
||||
assert isinstance(flight.state, InFlight)
|
||||
|
||||
@ -472,8 +472,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def heading(self) -> Heading:
|
||||
...
|
||||
def heading(self) -> Heading: ...
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
@ -594,8 +593,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def can_deploy_ground_units(self) -> bool:
|
||||
...
|
||||
def can_deploy_ground_units(self) -> bool: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
@ -880,8 +878,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def can_operate(self, aircraft: AircraftType) -> bool:
|
||||
...
|
||||
def can_operate(self, aircraft: AircraftType) -> bool: ...
|
||||
|
||||
def unclaimed_parking(self) -> int:
|
||||
return self.total_aircraft_parking - self.allocated_aircraft().total
|
||||
@ -892,8 +889,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
theater: ConflictTheater,
|
||||
conditions: Conditions,
|
||||
dynamic_runways: Dict[str, RunwayData],
|
||||
) -> RunwayData:
|
||||
...
|
||||
) -> RunwayData: ...
|
||||
|
||||
def stub_runway_data(self) -> RunwayData:
|
||||
return RunwayData(
|
||||
@ -910,13 +906,11 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def runway_is_destroyable(self) -> bool:
|
||||
...
|
||||
def runway_is_destroyable(self) -> bool: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def runway_status(self) -> RunwayStatus:
|
||||
...
|
||||
def runway_status(self) -> RunwayStatus: ...
|
||||
|
||||
@abstractmethod
|
||||
def describe_runway_status(self) -> str | None:
|
||||
@ -1074,13 +1068,11 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def category(self) -> str:
|
||||
...
|
||||
def category(self) -> str: ...
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def status(self) -> ControlPointStatus:
|
||||
...
|
||||
def status(self) -> ControlPointStatus: ...
|
||||
|
||||
|
||||
class Airfield(ControlPoint):
|
||||
|
||||
@ -107,7 +107,7 @@ class FrontLine(MissionTarget):
|
||||
yield from [
|
||||
FlightType.CAS,
|
||||
FlightType.AEWC,
|
||||
FlightType.REFUELING
|
||||
FlightType.REFUELING,
|
||||
# TODO: FlightType.TROOP_TRANSPORT
|
||||
# TODO: FlightType.EVAC
|
||||
]
|
||||
|
||||
@ -47,9 +47,9 @@ class TransitConnection(Enum):
|
||||
|
||||
class TransitNetwork:
|
||||
def __init__(self) -> None:
|
||||
self.nodes: Dict[
|
||||
ControlPoint, Dict[ControlPoint, TransitConnection]
|
||||
] = defaultdict(dict)
|
||||
self.nodes: Dict[ControlPoint, Dict[ControlPoint, TransitConnection]] = (
|
||||
defaultdict(dict)
|
||||
)
|
||||
|
||||
def has_destinations(self, control_point: ControlPoint) -> bool:
|
||||
return bool(self.nodes[control_point])
|
||||
|
||||
@ -29,6 +29,7 @@ transports and processing the turn's transit actions.
|
||||
|
||||
Routing is handled by TransitNetwork.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
@ -494,9 +495,9 @@ TransportType = TypeVar("TransportType", bound=MultiGroupTransport)
|
||||
class TransportMap(Generic[TransportType]):
|
||||
def __init__(self) -> None:
|
||||
# Dict of origin -> destination -> transport.
|
||||
self.transports: dict[
|
||||
ControlPoint, dict[ControlPoint, TransportType]
|
||||
] = defaultdict(dict)
|
||||
self.transports: dict[ControlPoint, dict[ControlPoint, TransportType]] = (
|
||||
defaultdict(dict)
|
||||
)
|
||||
|
||||
def create_transport(
|
||||
self, origin: ControlPoint, destination: ControlPoint
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Maps generated units back to their Liberation types."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import itertools
|
||||
|
||||
@ -101,8 +101,7 @@ class Weather(ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def archetype(self) -> WeatherArchetype:
|
||||
...
|
||||
def archetype(self) -> WeatherArchetype: ...
|
||||
|
||||
@property
|
||||
def pressure_adjustment(self) -> float:
|
||||
|
||||
@ -25,8 +25,7 @@ class WeibullWindSpeedParameters:
|
||||
|
||||
class WindSpeedGenerator(ABC):
|
||||
@abstractmethod
|
||||
def random_wind(self) -> WindConditions:
|
||||
...
|
||||
def random_wind(self) -> WindConditions: ...
|
||||
|
||||
@staticmethod
|
||||
def from_data(data: dict[str, Any]) -> WindSpeedGenerator:
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Application-wide dialog management."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from game.ato.flight import Flight
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Qt data models for game objects."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Spin box for selecting the number of aircraft in a flight."""
|
||||
|
||||
from PySide6.QtWidgets import QSpinBox
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""A layout containing a widget with an associated label."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Widgets for displaying air tasking orders."""
|
||||
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Widgets for displaying client slots."""
|
||||
|
||||
from PySide6.QtWidgets import QLabel
|
||||
|
||||
from qt_ui.models import AtoModel
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Combo box for selecting aircraft types."""
|
||||
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Combo box for selecting a departure airfield."""
|
||||
|
||||
from typing import Iterable, Optional
|
||||
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Dialog window for editing flights."""
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
QDialog,
|
||||
QVBoxLayout,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Dialogs for creating and editing ATO packages."""
|
||||
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Combo box for selecting squadrons."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
@ -1,2 +1 @@
|
||||
class MissingPropertyDataError(RuntimeError):
|
||||
...
|
||||
class MissingPropertyDataError(RuntimeError): ...
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Generates landmaps from GIS shapefiles."""
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import pickle
|
||||
|
||||
@ -17,8 +17,7 @@ from game import VERSION
|
||||
|
||||
class ReportElement(ABC):
|
||||
@abstractmethod
|
||||
def __str__(self) -> str:
|
||||
...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
|
||||
class Heading(ReportElement):
|
||||
@ -75,8 +74,7 @@ ReportStream: TypeAlias = Iterator[ReportElement]
|
||||
|
||||
|
||||
class LinterBase(ABC):
|
||||
def stream_reports(self) -> ReportStream:
|
||||
...
|
||||
def stream_reports(self) -> ReportStream: ...
|
||||
|
||||
|
||||
class UncheckedDataLinter(LinterBase):
|
||||
|
||||
@ -20,6 +20,7 @@ beacons = {
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import dataclasses
|
||||
import gettext
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Command-line utility for displaying human readable loadout configurations."""
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from collections.abc import Iterator
|
||||
|
||||
@ -23,12 +23,10 @@ def doctrine_from_name(name: str) -> Doctrine:
|
||||
|
||||
class Reducer(Generic[ReducerT], Iterator[ReducerT], ABC):
|
||||
@abstractmethod
|
||||
def accept(self) -> None:
|
||||
...
|
||||
def accept(self) -> None: ...
|
||||
|
||||
@abstractmethod
|
||||
def reject(self) -> None:
|
||||
...
|
||||
def reject(self) -> None: ...
|
||||
|
||||
|
||||
class MultiPolyReducer(Reducer[MultiPolygon]):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user