tournament

fun tournament(type: String, eloCalculator: EloCalculator = EloCalculator(), comparator: Comparator<Player> = defaultTiebreakerComparator, idGenerator: () -> Any? = null, id: Any? = 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 implementation matching the requested type.

Parameters

type

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

eloCalculator

The logic used for rating adjustments (optional).

comparator

The strategy for ranking players with tied scores (optional).

idGenerator

Unique ID generator for assigning identifiers to match objects.

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").

Throws

if the type provided is not recognized.