diff --git a/theater/controlpoint.py b/theater/controlpoint.py index 6fb0a855..f7514b71 100644 --- a/theater/controlpoint.py +++ b/theater/controlpoint.py @@ -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 diff --git a/theater/theatergroundobject.py b/theater/theatergroundobject.py index 47737934..a9f8188a 100644 --- a/theater/theatergroundobject.py +++ b/theater/theatergroundobject.py @@ -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__(