Class: PlayerManager

PlayerManager()

new PlayerManager()

Source:

Methods

AddPlayer(templateName) → {number}

Parameters:
Name Type Description
templateName string The template name of the player to add.
Source:
Returns:
- The player's ID (player number).
Type
number

GetActivePlayers()

Returns IDs of all players excluding gaia that are not defeated nor have won.
Source:

GetAllPlayers()

Returns IDs of all players including gaia.
Source:

GetNonGaiaPlayers()

Returns IDs of all players excluding gaia.
Source:

GetNumPlayers()

Returns the number of players including gaia.
Source:

GetPlayerByID()

Returns the player entity ID for the given player ID. The player ID must be valid (else there will be an error message).
Source:

RemoveLastPlayer()

Note: This should only be called during setup/init and not during a match since it doesn't change the owned entities.
Source:

ReplacePlayerTemplate(id, newTemplateName)

To avoid possible problems, we first remove all entities from this player, and add them back after the replacement. Note: This should only be called during setup/init and not during the game
Parameters:
Name Type Description
id number The player number to replace.
newTemplateName string The new template name for the player.
Source: