Warehouse¶
-
class
games.anarchy.warehouse.
Warehouse
¶ Bases:
games.anarchy.building.Building
The class representing the Warehouse in the Anarchy game.
A typical abandoned warehouse that anarchists hang out in and can be bribed to burn down Buildings.
-
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
exposure
¶ How exposed the anarchists in this warehouse are to PoliceDepartments. Raises when bribed to ignite buildings, and drops each turn if not bribed.
- Type
int
-
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
fire_added
¶ The amount of fire added to buildings when bribed to ignite a building. Headquarters add more fire than normal Warehouses.
- 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
-
ignite
(building: games.anarchy.building.Building) → int¶ Bribes the Warehouse to light a Building on fire. This adds this building’s fireAdded to their fire, and then this building’s exposure is increased based on the Manhattan distance between the two buildings.
- Parameters
building (games.anarchy.building.Building) – The Building you want to light on fire.
- Returns
The exposure added to this Building’s exposure. -1 is returned if there was an error.
- Return type
int
-
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