Fix some typing in preparation for pydcs types.

Not complete, but progress.

(cherry picked from commit 53f6a0b32b)
This commit is contained in:
Dan Albert
2021-07-08 22:50:55 -07:00
parent 19980e5d6b
commit 229a2cd7a4
30 changed files with 208 additions and 193 deletions

View File

@@ -106,7 +106,7 @@ class PatrolConfig:
@dataclass(frozen=True)
class AircraftType(UnitType[FlyingType]):
class AircraftType(UnitType[Type[FlyingType]]):
carrier_capable: bool
lha_capable: bool
always_keeps_gun: bool

View File

@@ -15,7 +15,7 @@ from game.dcs.unittype import UnitType
@dataclass(frozen=True)
class GroundUnitType(UnitType[VehicleType]):
class GroundUnitType(UnitType[Type[VehicleType]]):
unit_class: Optional[GroundUnitClass]
spawn_weight: int

View File

@@ -4,12 +4,12 @@ from typing import TypeVar, Generic, Type
from dcs.unittype import UnitType as DcsUnitType
DcsUnitTypeT = TypeVar("DcsUnitTypeT", bound=DcsUnitType)
DcsUnitTypeT = TypeVar("DcsUnitTypeT", bound=Type[DcsUnitType])
@dataclass(frozen=True)
class UnitType(Generic[DcsUnitTypeT]):
dcs_unit_type: Type[DcsUnitTypeT]
dcs_unit_type: DcsUnitTypeT
name: str
description: str
year_introduced: str