tournament

fun tournament(type: String, tiebreakers: JsArray<String> = arrayOf("fidePerformance", "buchholz", "progressive", "sonnebornBerger"), impactFactor: Double = 32.0, rangeFactor: Double = 400.0, logisticBase: Double = 10.0, idGenerator: () -> Any? = null, id: String? = null, name: String? = null, timeControl: String? = null, timeControlType: String? = null): Tournament

Factory function to create a Tournament instance based on the specified type.

Return

A Tournament instance.

Parameters

type

The tournament format to create. Supported values: "arena", "swiss".

tiebreakers

an array with the tiebreakers names in order. Supported values for each name are: "blackGames", "progressive", "sonnebornBerger", "fidePerformance", "linearPerformance", or "buchholz"

impactFactor

The K-factor that determines how much a single match affects the rating. A higher value leads to faster rating changes. Default is 32.0.

rangeFactor

The scale factor used to determine win probability. In standard Elo (like Chess), this is typically 400.0.

id

The unique identifier for this tournament.

name

The display name of the tournament.

timeControl

The specific time settings for the matches (e.g., "3+2", "10|0").

timeControlType

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

idGenerator

Unique ID generator for assigning identifiers to match objects.

logisticBase

The base of the exponent in the logistic function.

Throws

if the type provided is not recognized.