Beispiel #1
0
    def generate_ewr(self) -> None:
        position = self.location_finder.location_for(LocationType.Ewr)
        if position is None:
            return

        group_id = self.game.next_group_id()

        g = EwrGroundObject(namegen.random_objective_name(), group_id,
                            position, self.control_point)

        group = generate_ewr_group(self.game, g, self.faction)
        if group is None:
            logging.error(f"Could not generate EWR at {self.control_point}")
            return

        g.groups = [group]
        self.control_point.base_defenses.append(g)
Beispiel #2
0
    def generate_ewr_at(self, position: PointWithHeading) -> None:
        group_id = self.game.next_group_id()

        g = EwrGroundObject(
            namegen.random_objective_name(),
            group_id,
            position,
            self.control_point,
        )
        group = generate_ewr_group(self.game, g, self.faction)
        if group is None:
            logging.error(
                "Could not generate ewr group for %s at %s",
                g.name,
                self.control_point,
            )
            return
        g.groups = [group]
        self.control_point.connected_objectives.append(g)
Beispiel #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)})"
        )