Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Team

Hierarchy

  • Team

Index

Constructors

constructor

Properties

Private currentPlayer

currentPlayer: number = 0

Private Optional swappedPlayer

swappedPlayer: undefined | number

The index of the player that the current player is swapped with, if any.

There is only ever one swapped pair; a member of a swapped pair dying means that neither member of the pair is swapped anymore. This also means that there can be no background swapped pairs: if the active player is not in a swapped pair, then nobody else is either.

Methods

getCurrentPlayer

getSpeed

  • getSpeed(): number

playTurn

  • playTurn(opponentTeam: Team): { opponentActive: boolean; thisActive: true } | { opponentActive: true; thisActive: false }
  • Parameters

    • opponentTeam: Team

    Returns { opponentActive: boolean; thisActive: true } | { opponentActive: true; thisActive: false }

Private terminatePlayer

  • terminatePlayer(): boolean
  • Apply when current player is dead

    Returns boolean

    Whether the game is still active; i.e. whether there is another teammate who is alive