Building¶
-
class
games.anarchy.building.
Building
¶ Bases:
games.anarchy.game_object.GameObject
The class representing the Building in the Anarchy game.
A basic building. It does nothing besides burn down. Other Buildings inherit from this class.
-
property
bribed
¶ When True this building has already been bribed this turn and cannot be bribed again this turn.
- Type
bool
-
property
building_east
¶ The Building directly to the east of this building, or None if not present.
- Type
games.anarchy.building.Building or None
-
property
building_north
¶ The Building directly to the north of this building, or None if not present.
- Type
games.anarchy.building.Building or None
-
property
building_south
¶ The Building directly to the south of this building, or None if not present.
- Type
games.anarchy.building.Building or None
-
property
building_west
¶ The Building directly to the west of this building, or None if not present.
- Type
games.anarchy.building.Building or None
-
property
fire
¶ How much fire is currently burning the building, and thus how much damage it will take at the end of its owner’s turn. 0 means no fire.
- Type
int
-
property
game_object_name
¶ String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.
- Type
str
-
property
health
¶ How much health this building currently has. When this reaches 0 the Building has been burned down.
- Type
int
-
property
id
¶ A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.
- Type
str
-
property
is_headquarters
¶ True if this is the Headquarters of the owning player, False otherwise. Burning this down wins the game for the other Player.
- Type
bool
-
log
(message: str) → None¶ Adds a message to this GameObject’s logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.
- Parameters
message (str) – A string to add to this GameObject’s log. Intended for debugging.
-
property
logs
¶ Any strings logged will be stored here. Intended for debugging.
- Type
list[str]
-
property
owner
¶ The player that owns this building. If it burns down (health reaches 0) that player gets an additional bribe(s).
-
property
x
¶ The location of the Building along the x-axis.
- Type
int
-
property
y
¶ The location of the Building along the y-axis.
- Type
int
-
property