def add_settlement(self, position, radius, player, load=False): """Adds a settlement to the island at the position x, y with radius as area of influence. @param position: Rect describing the position of the new warehouse @param radius: int radius of the area of influence. @param player: int id of the player that owns the settlement""" settlement = Settlement(self.session, player) settlement.initialize() self.add_existing_settlement(position, radius, settlement, load) # TODO: Move this to command, this message should not appear while loading self.session.ingame_gui.message_widget.add(string_id='NEW_SETTLEMENT', point=position.center(), message_dict={'player':player.name}, play_sound=player.is_local_player) NewSettlement.broadcast(self, settlement) return settlement
def add_settlement(self, position, radius, player, load=False): """Adds a settlement to the island at the position x, y with radius as area of influence. @param position: Rect describing the position of the new warehouse @param radius: int radius of the area of influence. @param player: int id of the player that owns the settlement""" settlement = Settlement(self.session, player) settlement.initialize() self.add_existing_settlement(position, radius, settlement, load) # TODO: Move this to command, this message should not appear while loading self.session.ingame_gui.message_widget.add(position.center().x, \ position.center().y, \ 'NEW_SETTLEMENT', \ {'player':player.name}, \ self.session.world.player == player) self.session.world.notify_new_settlement() return settlement