diff --git a/game/campaignloader/campaign.py b/game/campaignloader/campaign.py index e14d6476..72bd187b 100644 --- a/game/campaignloader/campaign.py +++ b/game/campaignloader/campaign.py @@ -3,24 +3,24 @@ from __future__ import annotations import datetime import json import logging -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from pathlib import Path -from typing import Optional, Tuple, Dict, Any +from typing import Any, Dict, Optional, Tuple -from packaging.version import Version import yaml +from packaging.version import Version from game.profiling import logged_duration from game.theater import ( - ConflictTheater, CaucasusTheater, - NevadaTheater, - PersianGulfTheater, - NormandyTheater, - TheChannelTheater, - SyriaTheater, + ConflictTheater, MarianaIslandsTheater, + NevadaTheater, + NormandyTheater, + PersianGulfTheater, + SyriaTheater, + TheChannelTheater, ) from game.version import CAMPAIGN_FORMAT_VERSION from .campaignairwingconfig import CampaignAirWingConfig diff --git a/game/commander/garrisons.py b/game/commander/garrisons.py index 8ed43843..d6c69c95 100644 --- a/game/commander/garrisons.py +++ b/game/commander/garrisons.py @@ -1,6 +1,6 @@ from __future__ import annotations -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.theater import ControlPoint diff --git a/game/commander/objectivefinder.py b/game/commander/objectivefinder.py index 21fdd6f5..273accbb 100644 --- a/game/commander/objectivefinder.py +++ b/game/commander/objectivefinder.py @@ -2,16 +2,16 @@ from __future__ import annotations import math import operator -from collections import Iterator, Iterable -from typing import TypeVar, TYPE_CHECKING +from collections.abc import Iterable, Iterator +from typing import TYPE_CHECKING, TypeVar from game.theater import ( + Airfield, ControlPoint, - OffMapSpawn, - MissionTarget, Fob, FrontLine, - Airfield, + MissionTarget, + OffMapSpawn, ) from game.theater.theatergroundobject import ( BuildingGroundObject, @@ -19,7 +19,7 @@ from game.theater.theatergroundobject import ( NavalGroundObject, ) from game.utils import meters, nautical_miles -from gen.flights.closestairfields import ObjectiveDistanceCache, ClosestAirfields +from gen.flights.closestairfields import ClosestAirfields, ObjectiveDistanceCache if TYPE_CHECKING: from game import Game diff --git a/game/commander/tasks/compound/aewcsupport.py b/game/commander/tasks/compound/aewcsupport.py index 5e66cb01..d27ffb4b 100644 --- a/game/commander/tasks/compound/aewcsupport.py +++ b/game/commander/tasks/compound/aewcsupport.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.aewc import PlanAewc from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/attackairinfrastructure.py b/game/commander/tasks/compound/attackairinfrastructure.py index 993ce73e..50c452b6 100644 --- a/game/commander/tasks/compound/attackairinfrastructure.py +++ b/game/commander/tasks/compound/attackairinfrastructure.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.primitive.oca import PlanOcaStrike diff --git a/game/commander/tasks/compound/attackbuildings.py b/game/commander/tasks/compound/attackbuildings.py index 21e9a652..d00736fb 100644 --- a/game/commander/tasks/compound/attackbuildings.py +++ b/game/commander/tasks/compound/attackbuildings.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.strike import PlanStrike from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/attackgarrisons.py b/game/commander/tasks/compound/attackgarrisons.py index 479bcc71..9f029cfb 100644 --- a/game/commander/tasks/compound/attackgarrisons.py +++ b/game/commander/tasks/compound/attackgarrisons.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.bai import PlanBai from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/capturebase.py b/game/commander/tasks/compound/capturebase.py index 11936033..378cb13e 100644 --- a/game/commander/tasks/compound/capturebase.py +++ b/game/commander/tasks/compound/capturebase.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.compound.destroyenemygroundunits import ( @@ -10,7 +10,7 @@ from game.commander.tasks.compound.reduceenemyfrontlinecapacity import ( from game.commander.tasks.primitive.breakthroughattack import BreakthroughAttack from game.commander.theaterstate import TheaterState from game.htn import CompoundTask, Method -from game.theater import FrontLine, ControlPoint +from game.theater import ControlPoint, FrontLine @dataclass(frozen=True) diff --git a/game/commander/tasks/compound/capturebases.py b/game/commander/tasks/compound/capturebases.py index 3d338046..db9068ca 100644 --- a/game/commander/tasks/compound/capturebases.py +++ b/game/commander/tasks/compound/capturebases.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.compound.capturebase import CaptureBase diff --git a/game/commander/tasks/compound/defendbase.py b/game/commander/tasks/compound/defendbase.py index e7071489..ff1e1dcb 100644 --- a/game/commander/tasks/compound/defendbase.py +++ b/game/commander/tasks/compound/defendbase.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.primitive.cas import PlanCas diff --git a/game/commander/tasks/compound/defendbases.py b/game/commander/tasks/compound/defendbases.py index df18fdc3..87f14d68 100644 --- a/game/commander/tasks/compound/defendbases.py +++ b/game/commander/tasks/compound/defendbases.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.compound.defendbase import DefendBase diff --git a/game/commander/tasks/compound/degradeiads.py b/game/commander/tasks/compound/degradeiads.py index 21ddd02e..a40ae8e9 100644 --- a/game/commander/tasks/compound/degradeiads.py +++ b/game/commander/tasks/compound/degradeiads.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from typing import Union from game.commander.tasks.primitive.antiship import PlanAntiShip diff --git a/game/commander/tasks/compound/destroyenemygroundunits.py b/game/commander/tasks/compound/destroyenemygroundunits.py index 327acecd..fe54b57c 100644 --- a/game/commander/tasks/compound/destroyenemygroundunits.py +++ b/game/commander/tasks/compound/destroyenemygroundunits.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.primitive.aggressiveattack import AggressiveAttack diff --git a/game/commander/tasks/compound/frontlinedefense.py b/game/commander/tasks/compound/frontlinedefense.py index 11ed083e..36855862 100644 --- a/game/commander/tasks/compound/frontlinedefense.py +++ b/game/commander/tasks/compound/frontlinedefense.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.cas import PlanCas from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/interdictreinforcements.py b/game/commander/tasks/compound/interdictreinforcements.py index a76921db..d5b127ad 100644 --- a/game/commander/tasks/compound/interdictreinforcements.py +++ b/game/commander/tasks/compound/interdictreinforcements.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.antishipping import PlanAntiShipping from game.commander.tasks.primitive.convoyinterdiction import PlanConvoyInterdiction diff --git a/game/commander/tasks/compound/nextaction.py b/game/commander/tasks/compound/nextaction.py index 3b4559d3..33a1503c 100644 --- a/game/commander/tasks/compound/nextaction.py +++ b/game/commander/tasks/compound/nextaction.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.compound.attackairinfrastructure import ( diff --git a/game/commander/tasks/compound/protectairspace.py b/game/commander/tasks/compound/protectairspace.py index 79306c65..b5727259 100644 --- a/game/commander/tasks/compound/protectairspace.py +++ b/game/commander/tasks/compound/protectairspace.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.barcap import PlanBarcap from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/reduceenemyfrontlinecapacity.py b/game/commander/tasks/compound/reduceenemyfrontlinecapacity.py index 1b8b0e7c..22d3e728 100644 --- a/game/commander/tasks/compound/reduceenemyfrontlinecapacity.py +++ b/game/commander/tasks/compound/reduceenemyfrontlinecapacity.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.primitive.strike import PlanStrike diff --git a/game/commander/tasks/compound/refuelingsupport.py b/game/commander/tasks/compound/refuelingsupport.py index 6e2b141a..e1f26603 100644 --- a/game/commander/tasks/compound/refuelingsupport.py +++ b/game/commander/tasks/compound/refuelingsupport.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from game.commander.tasks.primitive.refueling import PlanRefueling from game.commander.theaterstate import TheaterState diff --git a/game/commander/tasks/compound/theatersupport.py b/game/commander/tasks/compound/theatersupport.py index 379ba7c2..94f8e040 100644 --- a/game/commander/tasks/compound/theatersupport.py +++ b/game/commander/tasks/compound/theatersupport.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass from game.commander.tasks.compound.aewcsupport import PlanAewcSupport diff --git a/game/commander/theaterstate.py b/game/commander/theaterstate.py index 7368b40e..9ece973d 100644 --- a/game/commander/theaterstate.py +++ b/game/commander/theaterstate.py @@ -3,23 +3,22 @@ from __future__ import annotations import dataclasses import itertools import math -from collections import Iterator +from collections.abc import Iterator from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Union, Optional +from typing import Any, Optional, TYPE_CHECKING, Union from game.commander.garrisons import Garrisons from game.commander.objectivefinder import ObjectiveFinder from game.htn import WorldState from game.profiling import MultiEventTracer from game.settings import Settings -from game.squadrons import AirWing -from game.theater import ControlPoint, FrontLine, MissionTarget, ConflictTheater +from game.theater import ConflictTheater, ControlPoint, FrontLine, MissionTarget from game.theater.theatergroundobject import ( - TheaterGroundObject, - NavalGroundObject, - IadsGroundObject, - VehicleGroupGroundObject, BuildingGroundObject, + IadsGroundObject, + NavalGroundObject, + TheaterGroundObject, + VehicleGroupGroundObject, ) from game.threatzones import ThreatZones from gen.ground_forces.combat_stance import CombatStance diff --git a/game/game.py b/game/game.py index a65fe5df..d22dca3f 100644 --- a/game/game.py +++ b/game/game.py @@ -3,7 +3,7 @@ from __future__ import annotations import itertools import logging import math -from collections import Iterator +from collections.abc import Iterator from datetime import date, datetime, timedelta from enum import Enum from typing import Any, List, TYPE_CHECKING, Type, Union, cast diff --git a/game/htn.py b/game/htn.py index 49699892..ae145262 100644 --- a/game/htn.py +++ b/game/htn.py @@ -1,7 +1,8 @@ from __future__ import annotations from abc import ABC, abstractmethod -from collections import Iterator, deque, Sequence +from collections import deque +from collections.abc import Iterator, Sequence from dataclasses import dataclass from typing import Any, Generic, Optional, TypeVar diff --git a/game/orderedset.py b/game/orderedset.py index 07a5964d..fcc28889 100644 --- a/game/orderedset.py +++ b/game/orderedset.py @@ -1,5 +1,5 @@ -from collections import Iterator, Iterable -from typing import Generic, TypeVar, Optional +from collections.abc import Iterable, Iterator +from typing import Generic, Optional, TypeVar ValueT = TypeVar("ValueT") diff --git a/game/settings/settings.py b/game/settings/settings.py index 7189755a..2e4168e2 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -1,4 +1,4 @@ -from collections import Iterator +from collections.abc import Iterator from dataclasses import Field, dataclass, field, fields from datetime import timedelta from enum import Enum, unique diff --git a/game/sim/aircraftsimulation.py b/game/sim/aircraftsimulation.py index 7dde4601..9ce5e376 100644 --- a/game/sim/aircraftsimulation.py +++ b/game/sim/aircraftsimulation.py @@ -1,7 +1,7 @@ from __future__ import annotations import itertools -from collections import Iterator +from collections.abc import Iterator from datetime import datetime, timedelta from typing_extensions import TYPE_CHECKING diff --git a/game/utils.py b/game/utils.py index 6d776b85..3b47b3cf 100644 --- a/game/utils.py +++ b/game/utils.py @@ -3,7 +3,7 @@ from __future__ import annotations import itertools import math import random -from collections import Iterable +from collections.abc import Iterable from dataclasses import dataclass from typing import TypeVar, Union diff --git a/gen/flights/loadouts.py b/gen/flights/loadouts.py index 057dc25f..4185bcb5 100644 --- a/gen/flights/loadouts.py +++ b/gen/flights/loadouts.py @@ -1,10 +1,10 @@ from __future__ import annotations import datetime -from collections import Iterable -from typing import Optional, Iterator, TYPE_CHECKING, Mapping +from collections.abc import Iterable +from typing import Iterator, Mapping, Optional, TYPE_CHECKING -from game.data.weapons import Weapon, Pylon, WeaponType +from game.data.weapons import Pylon, Weapon, WeaponType from game.dcs.aircrafttype import AircraftType if TYPE_CHECKING: diff --git a/qt_ui/errorreporter.py b/qt_ui/errorreporter.py index 3e514c10..8acf8a99 100644 --- a/qt_ui/errorreporter.py +++ b/qt_ui/errorreporter.py @@ -1,5 +1,5 @@ import logging -from collections import Iterator +from collections.abc import Iterator from contextlib import contextmanager from typing import Type diff --git a/qt_ui/main.py b/qt_ui/main.py index 14eda27f..3f8ace72 100644 --- a/qt_ui/main.py +++ b/qt_ui/main.py @@ -14,7 +14,7 @@ from dcs.payloads import PayloadDirectories from game import Game, VERSION, persistency from game.campaignloader.campaign import Campaign -from game.data.weapons import WeaponGroup, Pylon, Weapon +from game.data.weapons import Pylon, Weapon, WeaponGroup from game.db import FACTIONS from game.dcs.aircrafttype import AircraftType from game.profiling import logged_duration