Package horizons :: Package world :: Package building :: Module buildable :: Class BuildableSingleOnDeposit
[hide private]
[frames] | no frames]

Class BuildableSingleOnDeposit

source code

  Buildable --+    
              |    
BuildableSingle --+
                  |
                 BuildableSingleOnDeposit

For mines; those buildings are only buildable upon other buildings (clay pit on clay deposit, e.g.) For now, mines can only be built on a single type of deposit. This is specified in object files, and saved in cls.buildable_on_deposit in the buildingclass.

Class Methods [hide private]
 
_check_buildings(cls, session, position, island=None)
Check if there are buildings blocking the build
source code
 
_check_rotation(cls, session, position, rotation)
The rotation should be the same as the one of the underlying mountain
source code
    Inherited from BuildableSingle
 
check_build_line(cls, session, point1, point2, rotation=45, ship=None)
Checks out a line on the map for build possibilities.
source code
    Inherited from Buildable
 
_check_island(cls, session, position, island=None)
Check if there is an island and enough tiles.
source code
 
_check_settlement(cls, session, position, ship=None, issuer=None)
Check that there is a settlement that belongs to the player.
source code
 
_check_units(cls, session, position) source code
 
check_build(cls, session, point, rotation=45, check_settlement=True, ship=None, issuer=None)
Check if a building is buildable here.
source code
 
check_build_fuzzy(cls, session, point, *args, **kwargs)
Same as check_build, but consider point to be a vague suggestions and search nearby area for buildable position.
source code
 
is_tile_buildable(cls, session, tile, ship, island=None, check_settlement=True)
Checks a tile for buildability.
source code
Class Variables [hide private]
  irregular_conditions = True
  terrain_type = None
hash(x)
    Inherited from Buildable
  CHECK_NEARBY_LOCATIONS_UP_TO_DISTANCE = 3
Method Details [hide private]

_check_buildings(cls, session, position, island=None)
Class Method

source code 

Check if there are buildings blocking the build

Overrides: Buildable._check_buildings

_check_rotation(cls, session, position, rotation)
Class Method

source code 

The rotation should be the same as the one of the underlying mountain

Parameters:
  • position - Rect or Point instance, position and size
  • rotation - The preferred rotation
Returns:
integer, an available rotation in degrees
Overrides: Buildable._check_rotation