Fix mypy issue.

This commit is contained in:
Dan Albert 2020-11-07 16:33:00 -08:00
parent 11604671f8
commit 58481268f7
2 changed files with 12 additions and 4 deletions

View File

@ -18,7 +18,11 @@ from game import db
from gen.ground_forces.combat_stance import CombatStance
from .base import Base
from .missiontarget import MissionTarget
from .theatergroundobject import SamGroundObject, TheaterGroundObject
from .theatergroundobject import (
BaseDefenseGroundObject,
SamGroundObject,
TheaterGroundObject,
)
if TYPE_CHECKING:
from game import Game
@ -52,7 +56,7 @@ class ControlPoint(MissionTarget):
self.full_name = name
self.at = at
self.connected_objectives: List[TheaterGroundObject] = []
self.base_defenses: List[SamGroundObject] = []
self.base_defenses: List[BaseDefenseGroundObject] = []
self.size = size
self.importance = importance

View File

@ -186,10 +186,14 @@ class MissileSiteGroundObject(TheaterGroundObject):
)
class BaseDefenseGroundObject(TheaterGroundObject):
"""Base type for all base defenses."""
# TODO: Differentiate types.
# This type gets used both for AA sites (SAM, AAA, or SHORAD) but also for the
# armor garrisons at airbases. These should each be split into their own types.
class SamGroundObject(TheaterGroundObject):
class SamGroundObject(BaseDefenseGroundObject):
def __init__(self, name: str, group_id: int, position: Point,
control_point: ControlPoint, for_airbase: bool) -> None:
super().__init__(
@ -218,7 +222,7 @@ class SamGroundObject(TheaterGroundObject):
return super().group_name
class EwrGroundObject(TheaterGroundObject):
class EwrGroundObject(BaseDefenseGroundObject):
def __init__(self, name: str, group_id: int, position: Point,
control_point: ControlPoint) -> None:
super().__init__(