Class: EndGameManager

EndGameManager()

System component to store the victory conditions and their settings and check for allied victory / last-man-standing.

Constructor

new EndGameManager()

Source:

Methods

MarkPlayerAndAlliesAsWon(playerID, victoryReason)

Sets the given player (and the allies if allied victory is enabled) as a winner.
Parameters:
Name Type Description
playerID number The player that should win.
victoryReason function Function that maps from number to plural string, for example n => markForPluralTranslation( "%(lastPlayer)s has won (game mode).", "%(players)s and %(lastPlayer)s have won (game mode).", n));
Source:

MarkPlayersAsWon(winningPlayers, victoryReason)

Sets the given players as won and others as defeated.
Parameters:
Name Type Description
winningPlayers array The players that should win.
victoryReason function Function that maps from number to plural string, for example n => markForPluralTranslation( "%(lastPlayer)s has won (game mode).", "%(players)s and %(lastPlayer)s have won (game mode).", n));
Source: