Package horizons :: Package world :: Module buildingowner :: Class BuildingOwner
[hide private]
[frames] | no frames]

Class BuildingOwner

source code

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
add_building(self, building, player, load=False)
Adds a building to the island at the position x, y with player as the owner.
source code
 
remove_building(self, building) source code
 
get_settlements(self, rect, player=None)
Returns the list of settlements for the coordinates describing a rect.
source code
 
get_building(self, point)
Returns the building at the point
source code
 
get_settlement(self, point)
Look for a settlement at a specific coordinate
source code
 
get_tile(self, point)
Returns the tile at Point or None
source code
 
get_providers_in_range(self, radiusrect, res=None, reslist=None, player=None)
Returns all instances of provider within the specified shape.
source code
 
save(self, db) source code
 
end(self) source code
Method Details [hide private]

add_building(self, building, player, load=False)

source code 

Adds a building to the island at the position x, y with player as the owner.

Parameters:
  • building - Building class instance of the building that is to be added.
  • player - int id of the player that owns the settlement

get_settlements(self, rect, player=None)

source code 

Returns the list of settlements for the coordinates describing a rect.

Parameters:
  • rect - Area to search for settlements
Returns:
list of Settlement instances at that position.

get_building(self, point)

source code 

Returns the building at the point

Parameters:
  • point - position of the tile to look on
Returns:
Building class instance or None if none is found.

get_settlement(self, point)

source code 

Look for a settlement at a specific coordinate

Returns:
Settlement at point, or None

get_providers_in_range(self, radiusrect, res=None, reslist=None, player=None)

source code 

Returns all instances of provider within the specified shape. NOTE: Specifing the res parameter is usually a huge speed gain.

Parameters:
  • radiusrect - instance of RadiusShape
  • res - optional; only return providers that provide res. conflicts with reslist
  • reslist - optionally; list of res to search providers for. conflicts with res
  • player - Player instance, only buildings belonging to this player
Returns:
list of providers