Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Send hordes of the undead at your opponent while defending yourself against theirs to win.

Hierarchy

  • BaseGame
    • Game

Implements

  • IBaseGame

Index

Properties

currentPlayer

currentPlayer: Player

The player whose turn it is currently. That player can send commands. Other players cannot.

currentTurn

currentTurn: number

The current turn number, starting at 0 for the first player's turn.

gameObjects

gameObjects: object

A mapping of every game object's ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.

Type declaration

goldIncomePerUnit

goldIncomePerUnit: number

The amount of gold income per turn per unit in a mine.

islandIncomePerUnit

islandIncomePerUnit: number

The amount of gold income per turn per unit in the island mine.

manaIncomePerUnit

manaIncomePerUnit: number

The Amount of gold income per turn per unit fishing on the river side.

mapHeight

mapHeight: number

The number of Tiles in the map along the y (vertical) axis.

mapWidth

mapWidth: number

The number of Tiles in the map along the x (horizontal) axis.

maxTurns

maxTurns: number

The maximum number of turns before the game will automatically end.

players

players: Player[]

List of all the players in the game.

riverPhase

riverPhase: number

The amount of turns it takes between the river changing phases.

session

session: string

A unique identifier for the game instance that is being played.

tiles

tiles: Tile[]

All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index.

timeAddedPerTurn

timeAddedPerTurn: number

The amount of time (in nano-seconds) added after each player performs a turn.

towerJobs

towerJobs: TowerJob[]

A list of every tower type / job.

towers

towers: Tower[]

Every Tower in the game.

unitJobs

unitJobs: UnitJob[]

A list of every unit type / job.

units

units: Unit[]

Every Unit in the game.

Methods

getTileAt

  • getTileAt(x: number, y: number): Tile | undefined
  • Gets the Tile at a specified (x, y) position

    Parameters

    • x: number

      an integer between 0 and the mapWidth

    • y: number

      an integer between 0 and the mapHeight

    Returns Tile | undefined

    the Tile at (x, y) or null if out of bounds

Generated using TypeDoc