Disallow partially specified generics.

(cherry picked from commit 69c3d41a8a)
This commit is contained in:
Dan Albert
2021-07-07 16:01:20 -07:00
parent 65dfa8e209
commit 7cfd6b7151
5 changed files with 23 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ import time
from typing import List
from dcs.country import Country
from dcs.unittype import UnitType as DcsUnitType
from game.dcs.aircrafttype import AircraftType
from game.dcs.unittype import UnitType
@@ -293,7 +294,9 @@ class NameGenerator:
)
@classmethod
def next_unit_name(cls, country: Country, parent_base_id: int, unit_type: UnitType):
def next_unit_name(
cls, country: Country, parent_base_id: int, unit_type: UnitType[DcsUnitType]
) -> str:
cls.number += 1
return "unit|{}|{}|{}|{}|".format(
country.id, cls.number, parent_base_id, unit_type.name
@@ -301,8 +304,8 @@ class NameGenerator:
@classmethod
def next_infantry_name(
cls, country: Country, parent_base_id: int, unit_type: UnitType
):
cls, country: Country, parent_base_id: int, unit_type: UnitType[DcsUnitType]
) -> str:
cls.infantry_number += 1
return "infantry|{}|{}|{}|{}|".format(
country.id,