Queued match information, consisting of player IDs of players to compete
All competitors that are anonymous, local (no user), competitors and not registered in database. Used only when there is a DB
Registered competitors in this tournament
A reference to the dimension this tournament was spawned from
This tournament's ID
Promise array of which all resolves once every player added through constructor is finished adding
Logger
A queue whose elements are each arrays of players that are to compete against each other
Mapping match ids to active ongoing matches
This Tournament's name
The current status of the tournament
Add or update a player to the tournament
If no existing ID is specified, this is treated as adding a completely new player.
If existing ID is specified and that ID exists already, this will update the file for that player instead and effectively update the player. First time a player is added, if there is existing stats in a DB they won't be reset. Subsequent adds will change the stats.
If the player is to exist beyond the tournament, an existingID must always be provided and generated somewhere else
Resolves with the new player or updated player
The file to the bot or an object with the file and a name for the player specified
The optional id of the player. Can also be provided in the first arg in a object
Whether or not the player was called from initialization. If true, player version does not increment
Destroy this tournament. Rejects if an error occured in trying to destroy it.
Disables the player with id playerID
the player's id to disable
Returns a new id for identifying a player in a tournament Only used when adding a plyaer to a tournament is done without specifying an id to use.
Get the current tournament configs
Returns a key name to be used when storing a tournament by a combination of its name and id
Return an Array of Players corresponding to the player ids stored in queuedMatchInfo
Resolves with player stats if player with the id exists. Includes database user if db contains the player Fields are null if they don't exist. If playerStat field is null, then this player does not exist
id of player to get
Gets the rankings of the tournament. This will return the tournament rankings in the elimination tournament
Returns the name of the tournament but formatted (no spaces)
Handles a match and updates stats appropriately
Post run function before generic destroy takes place
Pre run function before generic destroy takes place
Removes a match by id. Returns true if deleted, false if nothing was deleted
Reesumes the tournament if it's stopped
Runs the tournament to completion. Resolves with Elimination.State once the tournament is finished
tournament configurations to use
Set configs to use. Merges the provided configurations and overwrites provided fields with what is provided
new tournament configs to update with
Performs a Fisher Yates Shuffle
the array to shuffle
Stops the tournament if it's running
Generates a 6 character tournament ID identifying this tournament class instance. Not to be confused with {@link Tournament.ID} which is the ID for competitors in the tournament
Generated using TypeDoc
The Elimination Tournament Class. Runs a single-elimination tournament. The Elimination Tournament namespace
Meant for single instance use only