コード例 #1
0
    def generate_missile_site_at(self, position: PointWithHeading) -> None:
        group_id = self.game.next_group_id()

        g = MissileSiteGroundObject(namegen.random_objective_name(), group_id,
                                    position, self.control_point)
        group = generate_missile_group(self.game, g, self.faction_name)
        g.groups = []
        if group is not None:
            g.groups.append(group)
            self.control_point.connected_objectives.append(g)
        return
コード例 #2
0
    def generate_missile_site(self) -> None:
        position = self.location_finder.location_for(LocationType.MissileSite)
        if position is None:
            return

        group_id = self.game.next_group_id()

        g = MissileSiteGroundObject(namegen.random_objective_name(), group_id,
                                    position, self.control_point)
        group = generate_missile_group(self.game, g, self.faction_name)
        g.groups = []
        if group is not None:
            g.groups.append(group)
            self.control_point.connected_objectives.append(g)
        return
コード例 #3
0
 def create_ground_object(
     self,
     name: str,
     position: PointWithHeading,
     control_point: ControlPoint,
 ) -> TheaterGroundObject:
     if GroupTask.MISSILE in self.tasks:
         return MissileSiteGroundObject(
             name, position, position.heading, control_point
         )
     elif GroupTask.COASTAL in self.tasks:
         return CoastalSiteGroundObject(
             name, position, control_point, position.heading
         )
     raise NotImplementedError