Tournament

interface Tournament

Contract for tournament management.

Since

1.0.0-beta.8

Author

lunalobos

Inheritors

Properties

Link copied to clipboard
abstract val activeMatches: List<Match>

Current matches being played.

Link copied to clipboard
abstract var completed: Boolean

Whether the tournament has reached its conclusion.

Link copied to clipboard

The engine used to calculate rating changes.

Link copied to clipboard
abstract val finishedMatches: List<Match>

All concluded matches in the tournament history.

Link copied to clipboard
abstract val id: Any?

The unique identifier for this tournament.

Link copied to clipboard
abstract val idGenerator: () -> Any?

Unique ID generator for assigning identifiers to match objects.

Link copied to clipboard
abstract val leaderboard: List<Player>

Current player standings, ordered by score and tie-breakers.

Link copied to clipboard
abstract val name: String?

The display name of the tournament.

Link copied to clipboard

The strategy for breaking ties in the leaderboard.

Link copied to clipboard
abstract val timeControl: String?

The specific time settings for the matches (e.g., "3+2", "10|0"). Returns null if no specific time control has been defined.

Link copied to clipboard
abstract val type: String?

The category of the tournament based on the time control (e.g., "blitz", "bullet", "rapid").

Functions

Link copied to clipboard
abstract fun addMatch(white: String, black: String?, outcome: String, id: Any?, round: Int?): Boolean

Adds a match to the tournament for the specified round. This method is ideal for cases where external logic is being used or an instance is being reconstructed.

Link copied to clipboard
abstract fun addPlayer(player: Player)

Adds a player to the tournament. The player's name must be unique.

Link copied to clipboard
abstract fun nextRound(): List<Match>

Generates a list of new pairings.

Link copied to clipboard
abstract fun removePlayer(player: Player)

Removes a player from the tournament.