Fix mypy regressions.

This commit is contained in:
Dan Albert 2020-11-26 20:08:24 -08:00
parent 9f078e1483
commit 5d4fccd438
2 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import logging
import math import math
import pickle import pickle
import random import random
from typing import Any, Dict, List, Optional from typing import Any, Dict, Iterable, Optional
from dcs.mapping import Point from dcs.mapping import Point
from dcs.task import CAP, CAS, PinpointStrike from dcs.task import CAP, CAS, PinpointStrike
@ -632,7 +632,7 @@ class AirbaseGroundObjectGenerator(ControlPointGroundObjectGenerator):
self.generate_aa_at(position) self.generate_aa_at(position)
def generate_aa_at(self, position: Point, def generate_aa_at(self, position: Point,
filter_names: Optional[List[str]] = None) -> None: filter_names: Optional[Iterable[str]] = None) -> None:
group_id = self.game.next_group_id() group_id = self.game.next_group_id()
g = SamGroundObject(namegen.random_objective_name(), group_id, g = SamGroundObject(namegen.random_objective_name(), group_id,

View File

@ -1,10 +1,10 @@
import random import random
from typing import List, Optional, Type from typing import Iterable, List, Optional, Type
from dcs.unitgroup import VehicleGroup from dcs.unitgroup import VehicleGroup
from dcs.vehicles import AirDefence from dcs.vehicles import AirDefence
from game import Game, db from game import Game
from game.factions.faction import Faction from game.factions.faction import Faction
from game.theater import TheaterGroundObject from game.theater import TheaterGroundObject
from game.theater.theatergroundobject import SamGroundObject from game.theater.theatergroundobject import SamGroundObject
@ -151,7 +151,8 @@ EWR_MAP = {
def get_faction_possible_sams_generator( def get_faction_possible_sams_generator(
faction: Faction, faction: Faction,
filter_names: Optional[List[str]] = None) -> List[Type[GroupGenerator]]: filter_names: Optional[Iterable[str]] = None
) -> List[Type[GroupGenerator]]:
""" """
Return the list of possible SAM generator for the given faction Return the list of possible SAM generator for the given faction
:param faction: Faction name to search units for :param faction: Faction name to search units for
@ -171,7 +172,7 @@ def get_faction_possible_ewrs_generator(faction: Faction) -> List[Type[GroupGene
def generate_anti_air_group( def generate_anti_air_group(
game: Game, ground_object: TheaterGroundObject, faction: Faction, game: Game, ground_object: TheaterGroundObject, faction: Faction,
filter_names: Optional[List[str]] = None) -> Optional[VehicleGroup]: filter_names: Optional[Iterable[str]] = None) -> Optional[VehicleGroup]:
""" """
This generate a SAM group This generate a SAM group
:param game: The Game. :param game: The Game.