WeatherStation

class games.anarchy.weather_station.WeatherStation

Bases: games.anarchy.building.Building

The class representing the WeatherStation in the Anarchy game.

Can be bribed to change the next Forecast in some way.

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

intensify(negative: bool = False) → bool

Bribe the weathermen to intensity the next Forecast by 1 or -1.

Parameters

negative (bool) – By default the intensity will be increased by 1, setting this to True decreases the intensity by 1.

Returns

True if the intensity was changed, False otherwise.

Return type

bool

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).

Type

games.anarchy.player.Player

rotate(counterclockwise: bool = False) → bool

Bribe the weathermen to change the direction of the next Forecast by rotating it clockwise or counterclockwise.

Parameters

counterclockwise (bool) – By default the direction will be rotated clockwise. If you set this to True we will rotate the forecast counterclockwise instead.

Returns

True if the rotation worked, False otherwise.

Return type

bool

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