Esempio n. 1
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)
    def generate_ewr(self) -> None:
        position = self.location_finder.location_for(LocationType.BaseEwr)
        if position is None:
            return

        group_id = self.game.next_group_id()

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

        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)