Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Warehouse

A typical abandoned warehouse that anarchists hang out in and can be bribed to burn down Buildings.

Hierarchy

Implements

  • IBaseGameObject

Index

Properties

bribed

bribed: boolean

When true this building has already been bribed this turn and cannot be bribed again this turn.

buildingEast

buildingEast: Building | undefined

The Building directly to the east of this building, or null if not present.

buildingNorth

buildingNorth: Building | undefined

The Building directly to the north of this building, or null if not present.

buildingSouth

buildingSouth: Building | undefined

The Building directly to the south of this building, or null if not present.

buildingWest

buildingWest: Building | undefined

The Building directly to the west of this building, or null if not present.

exposure

exposure: number

How exposed the anarchists in this warehouse are to PoliceDepartments. Raises when bribed to ignite buildings, and drops each turn if not bribed.

fire

fire: number

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.

fireAdded

fireAdded: number

The amount of fire added to buildings when bribed to ignite a building. Headquarters add more fire than normal Warehouses.

gameObjectName

gameObjectName: string

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.

health

health: number

How much health this building currently has. When this reaches 0 the Building has been burned down.

id

id: string

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.

isHeadquarters

isHeadquarters: boolean

True if this is the Headquarters of the owning player, false otherwise. Burning this down wins the game for the other Player.

logs

logs: string[]

Any strings logged will be stored here. Intended for debugging.

owner

owner: Player

The player that owns this building. If it burns down (health reaches 0) that player gets an additional bribe(s).

x

x: number

The location of the Building along the x-axis.

y

y: number

The location of the Building along the y-axis.

Methods

ignite

  • ignite(building: Building): Promise<number>
  • 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: Building

      The Building you want to light on fire.

    Returns Promise<number>

    The exposure added to this Building's exposure. -1 is returned if there was an error.

log

  • log(message: string): Promise<void>
  • 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: string

      A string to add to this GameObject's log. Intended for debugging.

    Returns Promise<void>

toString

  • toString(): string
  • A toString override for easier debugging.

    example

    String(gameObject); 🠞 "GameObjectName #1245"

    Returns string

    A human readable representation of the game object.

Generated using TypeDoc