Hierarchy

  • BaseGetter
    • Get

Constructors

  • Creates an instance of a Storage getter.

    Parameters

    • storage: Storage

      The implementation of Storage.

    Returns Get

Properties

storage: Storage

Methods

  • Returns the matches that can currently be played in parallel. If the stage doesn't contain any, an empty array is returned.

    Note:

    • Returned matches are ongoing (i.e. ready or running).
    • Returned matches can be from different rounds.

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<Match[]>

    Example

    If you don't know the stage id, you can first get the current stage.

    const tournamentId = 3;
    const currentStage = await manager.get.currentStage(tournamentId);
    const currentMatches = await manager.get.currentMatches(currentStage.id);
  • Returns the round that is not completed yet, because of uncompleted matches. If all matches are completed in this stage of a tournament, there is no "current round", so null is returned.

    Note: The consolation final of single elimination and the grand final of double elimination will be in a different Group.

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<null | Round>

    Example

    If you don't know the stage id, you can first get the current stage.

    const tournamentId = 3;
    const currentStage = await manager.get.currentStage(tournamentId);
    const currentRound = await manager.get.currentRound(currentStage.id);
  • Returns the stage that is not completed yet, because of uncompleted matches. If all matches are completed in this tournament, there is no "current stage", so null is returned.

    Parameters

    • tournamentId: Id

      ID of the tournament.

    Returns Promise<null | Stage>

  • Finds a match in a given group. The match must have the given number in a round of which the number in group is given.

    Example: In group of id 1, give me the 4th match in the 3rd round.

    Parameters

    • groupId: Id

      ID of the group.

    • roundNumber: number

      Number of the round in its parent group.

    • matchNumber: number

      Number of the match in its parent round.

    Returns Promise<Match>

  • Finds a match game based on its id or based on the combination of its parent_id and number.

    Parameters

    • game: {
          id?: Id;
          number?: number;
          opponent1?: null | ({ id?: Id | null | undefined; position?: number | undefined; forfeit?: boolean | undefined; score?: number | undefined; result?: Result | undefined; });
          opponent2?: null | ({ id?: Id | null | undefined; position?: number | undefined; forfeit?: boolean | undefined; score?: number | undefined; result?: Result | undefined; });
          parent_id?: Id;
          stage_id?: Id;
          status?: Status;
      }

      Values to change in a match game.

      • Optional id?: Id

        ID of the match game.

      • Optional number?: number

        The number of the match game in its parent match.

      • Optional opponent1?: null | ({ id?: Id | null | undefined; position?: number | undefined; forfeit?: boolean | undefined; score?: number | undefined; result?: Result | undefined; })

        First opponent of the match.

      • Optional opponent2?: null | ({ id?: Id | null | undefined; position?: number | undefined; forfeit?: boolean | undefined; score?: number | undefined; result?: Result | undefined; })

        Second opponent of the match.

      • Optional parent_id?: Id

        ID of the parent match.

      • Optional stage_id?: Id

        ID of the parent stage.

      • Optional status?: Status

        Status of the match.

    Returns Promise<MatchGame>

  • Gets the loser bracket.

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<null | Group>

  • Gets the match(es) where the opponents of the current match will go just after.

    Parameters

    • match: Match

      The current match.

    • matchLocation: GroupType

      Location of the current match.

    • stage: Stage

      The parent stage.

    • roundNumber: number

      The number of the current round.

    • roundCount: number

      Count of rounds.

    Returns Promise<(null | Match)[]>

  • Gets all the rounds that contain ordered participants.

    Parameters

    • stage: Stage

      The stage to get rounds from.

    Returns Promise<Round[]>

  • Gets the matches leading to the given match.

    Parameters

    • match: Match

      The current match.

    • matchLocation: GroupType

      Location of the current match.

    • stage: Stage

      The parent stage.

    • roundNumber: number

      Number of the round.

    Returns Promise<Match[]>

  • Gets the positional information (number in group and total number of rounds in group) of a round based on its id.

    Parameters

    • roundId: Id

      ID of the round.

    Returns Promise<RoundPositionalInfo>

  • Returns the matches which contain the seeding of a stage based on its type.

    Parameters

    • stageId: Id

      ID of the stage.

    • stageType: StageType

      The type of the stage.

    Returns Promise<null | Match[]>

  • Returns only the data specific to the given stage (without the participants).

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<{
        groups: Group[];
        matchGames: MatchGame[];
        matches: Match[];
        rounds: Round[];
        stage: Stage;
    }>

  • Gets the upper bracket (the only bracket if single elimination or the winner bracket in double elimination).

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<Group>

  • Returns the match games associated to a list of matches.

    Parameters

    • matches: Match[]

      A list of matches.

    Returns Promise<MatchGame[]>

  • Returns the good seeding ordering based on the stage's type.

    Parameters

    • stageType: StageType

      The type of the stage.

    • create: StageCreator

      A reference to a Create instance.

    Returns SeedOrdering

Generated using TypeDoc