Make EWR sites purchasable.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/968
This commit is contained in:
Dan Albert
2021-05-31 16:32:43 -07:00
parent 45919200c4
commit 8604faffe6
6 changed files with 111 additions and 24 deletions

View File

@@ -21,6 +21,8 @@ class AirDefenseGroupGenerator(GroupGenerator, ABC):
This is the base for all SAM group generators
"""
price: int
def __init__(self, game: Game, ground_object: SamGroundObject) -> None:
ground_object.skynet_capable = True
super().__init__(game, ground_object)

View File

@@ -17,8 +17,8 @@ from gen.sam.ewrs import (
SnowDriftGenerator,
StraightFlushGenerator,
TallRackGenerator,
EwrGenerator,
)
from gen.sam.group_generator import GroupGenerator
EWR_MAP = {
"BoxSpringGenerator": BoxSpringGenerator,
@@ -36,7 +36,7 @@ EWR_MAP = {
def get_faction_possible_ewrs_generator(
faction: Faction,
) -> List[Type[GroupGenerator]]:
) -> List[Type[EwrGenerator]]:
"""
Return the list of possible EWR generators for the given faction
:param faction: Faction name to search units for

View File

@@ -5,9 +5,16 @@ from gen.sam.group_generator import GroupGenerator
class EwrGenerator(GroupGenerator):
@property
def unit_type(self) -> VehicleType:
raise NotImplementedError
unit_type: VehicleType
@classmethod
def name(cls) -> str:
return cls.unit_type.name
@staticmethod
def price() -> int:
# TODO: Differentiate sites.
return 20
def generate(self) -> None:
self.add_unit(