mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
More adaptation for pydcs updates.
This is as much as we can do until pydcs actually adds the py.typed file. Once that's added there are a few ugly monkey patching corners that will just need `# type: ignore` for now, but we can't pre-add those since we have mypy warning us about superfluous ignore comments.
This commit is contained in:
@@ -5,14 +5,14 @@ import inspect
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, Iterator, Optional, Set, Tuple, Union, cast, Any
|
||||
from typing import Dict, Iterator, Optional, Set, Tuple, cast, Any
|
||||
|
||||
from dcs.unitgroup import FlyingGroup
|
||||
from dcs.weapons_data import Weapons, weapon_ids
|
||||
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
|
||||
PydcsWeapon = Dict[str, Any]
|
||||
PydcsWeapon = Any
|
||||
PydcsWeaponAssignment = Tuple[int, PydcsWeapon]
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class Pylon:
|
||||
# configuration.
|
||||
return weapon in self.allowed or weapon.cls_id == "<CLEAN>"
|
||||
|
||||
def equip(self, group: FlyingGroup, weapon: Weapon) -> None:
|
||||
def equip(self, group: FlyingGroup[Any], weapon: Weapon) -> None:
|
||||
if not self.can_equip(weapon):
|
||||
logging.error(f"Pylon {self.number} cannot equip {weapon.name}")
|
||||
group.load_pylon(self.make_pydcs_assignment(weapon), self.number)
|
||||
|
||||
Reference in New Issue
Block a user