def generate_ship_at(self, position: PointWithHeading) -> None: group_id = self.game.next_group_id() g = ShipGroundObject(namegen.random_objective_name(), group_id, position, self.control_point) group = generate_ship_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)
def generate_ship(self) -> None: point = self.location_finder.location_for( LocationType.OffshoreStrikeTarget) if point is None: return group_id = self.game.next_group_id() g = ShipGroundObject(namegen.random_objective_name(), group_id, point, self.control_point) group = generate_ship_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)
def create_ground_object( self, name: str, position: PointWithHeading, control_point: ControlPoint, ) -> TheaterGroundObject: if GroupTask.NAVY in self.tasks: return ShipGroundObject(name, position, control_point) elif GroupTask.AIRCRAFT_CARRIER in self.tasks: return CarrierGroundObject(name, control_point) elif GroupTask.HELICOPTER_CARRIER in self.tasks: return LhaGroundObject(name, control_point) raise NotImplementedError