mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Disallow partially specified generics.
(cherry picked from commit 69c3d41a8a)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user