Exemplo n.º 1
0
	def add_settlement(self, position, radius, player):
		"""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()
		settlement.init_buildability_cache(self.terrain_cache)
		self.add_existing_settlement(position, radius, settlement)
		NewSettlement.broadcast(self, settlement, position.center)

		return settlement
Exemplo n.º 2
0
    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()
        settlement.init_buildability_cache(self.terrain_cache)
        self.add_existing_settlement(position, radius, settlement, load)
        NewSettlement.broadcast(self, settlement, position.center)

        return settlement
Exemplo n.º 3
0
	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
Exemplo n.º 4
0
    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