tournament-organizer
    Preparing search index...

    Class Player

    Class representing a player

    See PlayerValues for detailed descriptions of properties.

    Index

    Constructors

    Methods

    • Adds a match to the player's record.

      Throws an error if attempting to duplicate a match.

      Parameters

      • match: {
            bye?: boolean;
            draw?: number;
            id: string;
            loss?: number;
            opponent: string;
            pairUpDown?: boolean;
            seating?: -1 | 1;
            win?: number;
        }

        Object with match details

      Returns void

    • Returns {
          bye: boolean;
          draw: number;
          id: string;
          loss: number;
          opponent: string;
          pairUpDown: boolean;
          seating: -1 | 1;
          win: number;
      }[]

      An array of matches the player is in

      • bye: boolean

        If the match is a bye.

      • draw: number

        Number of draws in the match.

      • id: string

        The ID of the match.

      • loss: number

        Number of losses for the player in the match.

      • opponent: string

        The ID of the opponent (or null if no opponent).

      • pairUpDown: boolean

        If the opponent has a different point total before the match (used in Swiss pairings).

      • seating: -1 | 1

        If the player is player one (1) or player two (-1) in the match (used if seating: true).

      • win: number

        Number of wins for the player in the match.

    • Returns { [key: string]: any }

      Any extra information

    • Returns string[]

      An array of IDs of the player's opponents

    • Returns number

      The value for the player, such as rating or seed

    • Removes a match from player history.

      Throws an error if the match doesn't exist in the player's records.

      Parameters

      • id: string

        The ID of the match

      Returns void

    • Updates the details of a match.

      Throws an error if the match doesn't exist in the player's records.

      Only needs to contain properties that are being changed.

      Parameters

      • id: string

        The ID of the match

      • values: {
            bye?: boolean;
            draw?: number;
            loss?: number;
            opponent?: string;
            pairUpDown?: boolean;
            seating?: -1 | 1;
            win?: number;
        }

        The match details being changed

      Returns void