Esempio n. 1
0
    def generate_shorad(self) -> None:
        position = self.location_finder.location_for(
            LocationType.BaseAirDefense)
        if position is None:
            return

        group_id = self.game.next_group_id()

        g = SamGroundObject(
            namegen.random_objective_name(),
            group_id,
            position,
            self.control_point,
            for_airbase=True,
        )

        groups = generate_anti_air_group(self.game,
                                         g,
                                         self.faction,
                                         ranges=[{AirDefenseRange.Short}])
        if not groups:
            logging.error(
                f"Could not generate SHORAD group at {self.control_point}")
            return
        g.groups = groups
        self.control_point.base_defenses.append(g)
Esempio n. 2
0
    def generate_aa_at(self, position: Point,
                       ranges: Iterable[Set[AirDefenseRange]]) -> None:
        group_id = self.game.next_group_id()

        g = SamGroundObject(namegen.random_objective_name(),
                            group_id,
                            position,
                            self.control_point,
                            for_airbase=False)
        group = generate_anti_air_group(self.game, g, self.faction, ranges)
        if group is None:
            logging.error("Could not generate air defense group for %s at %s",
                          g.name, self.control_point)
            return
        g.groups = [group]
        self.control_point.connected_objectives.append(g)
Esempio n. 3
0
    def create_ground_object(
        self,
        name: str,
        position: PointWithHeading,
        control_point: ControlPoint,
    ) -> IadsGroundObject:

        if GroupTask.EARLY_WARNING_RADAR in self.tasks:
            return EwrGroundObject(name, position, position.heading, control_point)
        elif any(tasking in self.tasks for tasking in GroupRole.AIR_DEFENSE.tasks):
            return SamGroundObject(name, position, position.heading, control_point)
        raise RuntimeError(
            f" No Template for AntiAir tasking ({', '.join(task.description for task in self.tasks)})"
        )
Esempio n. 4
0
    def generate_sam(self) -> None:
        position = self.location_finder.location_for(
            LocationType.BaseAirDefense)
        if position is None:
            return

        group_id = self.game.next_group_id()

        g = SamGroundObject(namegen.random_objective_name(),
                            group_id,
                            position,
                            self.control_point,
                            for_airbase=True)

        group = generate_anti_air_group(self.game, g, self.faction)
        if group is None:
            logging.error(f"Could not generate SAM at {self.control_point}")
            return
        g.groups.append(group)
        self.control_point.base_defenses.append(g)
Esempio n. 5
0
 def __init__(self, game: Game, ground_object: SamGroundObject) -> None:
     ground_object.skynet_capable = True
     super().__init__(game, ground_object)
Esempio n. 6
0
    def __init__(self, game: Game, ground_object: SamGroundObject) -> None:
        ground_object.skynet_capable = True
        super().__init__(game, ground_object)

        self.auxiliary_groups: List[VehicleGroup] = []