Format with updated black

This commit is contained in:
Raffson
2024-10-12 17:20:44 +02:00
parent 11a9d67b91
commit 5fdf38c663
58 changed files with 164 additions and 187 deletions

View File

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

View File

@@ -57,8 +57,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,
@@ -122,9 +121,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:
@@ -158,9 +157,7 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
return (
1.0
if target.task in [GroupTask.LORAD, GroupTask.MERAD]
else 0.5
if target.task == GroupTask.AAA
else 0.9
else 0.5 if target.task == GroupTask.AAA else 0.9
)
def iter_detecting_iads(

View File

@@ -12,5 +12,4 @@ if TYPE_CHECKING:
class TheaterCommanderTask(PrimitiveTask[TheaterState]):
@abstractmethod
def execute(self, coalition: Coalition) -> None:
...
def execute(self, coalition: Coalition) -> None: ...

View File

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

View File

@@ -203,7 +203,7 @@ class TheaterState(WorldState["TheaterState"]):
threat_zones=game.threat_zone_for(not player),
vulnerable_control_points=vulnerable_control_points,
control_point_priority_queue=ordered_capturable_points,
priority_cp=ordered_capturable_points[0]
if ordered_capturable_points
else None,
priority_cp=(
ordered_capturable_points[0] if ordered_capturable_points else None
),
)