Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Gather branches and build up your lodge as beavers fight to survive.

Hierarchy

  • BaseGame
    • Game

Implements

  • IBaseGame

Index

Properties

beavers

beavers: Beaver[]

Every Beaver in the game.

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.

freeBeaversCount

freeBeaversCount: number

When a Player has less Beavers than this number, then recruiting other Beavers is free.

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

jobs

jobs: Job[]

All the Jobs that Beavers can have in the game.

lodgeCostConstant

lodgeCostConstant: number

Constant number used to calculate what it costs to spawn a new lodge.

lodgesToWin

lodgesToWin: number

How many lodges must be owned by a Player at once to win the game.

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.

session

session: string

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

spawner

spawner: Spawner[]

Every Spawner in the game.

spawnerHarvestConstant

spawnerHarvestConstant: number

Constant number used to calculate how many branches/food Beavers harvest from Spawners.

spawnerTypes

spawnerTypes: string[]

All the types of Spawners in the game.

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.

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