Creates a new tournament.
Tournament configuration.
The current round number (1-based), or 0 if no round has been paired yet.
All recorded games, grouped by round. Returns a defensive copy.
Whether all rounds have been paired and all results recorded.
All tournament participants. Returns a defensive copy.
Total number of rounds in the tournament.
Ordered list of tiebreak identifiers. Returns a defensive copy.
Removes a previously recorded result from the specified round. The game is identified by the player pair (checked in both color orderings).
After clearing, the round becomes incomplete and the pairing can be re-recorded via recordResult.
The 1-based round number.
One of the two player identifiers.
The other player identifier.
StaticfromRestores a tournament from a serialized snapshot. The pairing system function must be re-provided since functions are not JSON-serializable.
A snapshot previously returned by toJSON.
The pairing function to use for future rounds.
Optionalacceleration: AccelerationMethodOptional acceleration method.
A restored Tournament instance.
Generates pairings for the next round using the injected pairing system.
The pairings and byes for the new round.
Returns players ranked by score descending, with optional tiebreaks applied in order. Tied players (same score and all tiebreak values) share the same rank.
Ordered array of tiebreak functions. Each receives
(playerId, games, players) and returns a number. Higher values rank
higher.
Sorted standings array.
Serializes the tournament state to a plain object suitable for
JSON.stringify.
A serializable snapshot of the tournament.
Replaces an existing result in any round. The game is identified by the
white/black player pair (checked in both orderings). The stored game
retains its original color assignment.
Stateful chess tournament orchestrator. Drives any pairing system through a common lifecycle: create, pair, record results, standings, repeat.
The pairing system is injected as a function parameter — the consumer provides it from
@echecs/swiss,@echecs/round-robin, or a custom implementation.Example