Options
All
  • Public
  • Public/Protected
  • All
Menu

@nttb/tt-match-ranking

Index

Type aliases

TTSetRules

TTSetRules: TTSetRules_BestOf

The set rules (currently only winning by "best-of" is supported)

Functions

assertGameRules

assertMatchRules

assertSetRules

generateMatchRank

  • Generates the ranking.

    Type parameters

    • T

    Parameters

    • match: TTMatch<T>

      The match of which the players need to be ranked

    • matchRules: TTMatchRules

      The rules of the match

    • setRules: TTSetRules

      The rules for every set

    Returns TTMatchRank<T>

    The ranking sorted according to the table tennis rules.

parseGameScore

  • parseGameScore(input: string): TTGame
  • Parses the game score to an object

    Game scores are written as 11-9 where the first value represents the home score and the second one the away score.

    Parameters

    • input: string

    Returns TTGame

parseSetScore

  • parseSetScore(input: string): TTSet
  • Parses the set score to an object. The input is a string of game-scores (11-9) where each game score is seperated by a comma (,). Set score can also be wo:home or wo:away which stands for a walkover. A walkover occurs when a when no games are played due to a player/side not starting the set.

    Examples:

    • 11-9,10-12 - Two sets were played, 11-9 and 10-12
    • wo:home - The home player has won by default
    • wo:away - The away player has won by default

    Parameters

    • input: string

    Returns TTSet

Generated using TypeDoc