Class StageCreator

Hierarchy

  • StageCreator

Constructors

Properties

currentStageId: Id
enableByesInUpdate: boolean
seedOrdering: SeedOrdering[]
stage: InputStage
storage: Storage
updateMode: boolean

Methods

  • Creates a consolation final for the semi final losers of an upper bracket (single or double elimination).

    Parameters

    • stageId: Id

      ID of the stage.

    • losers: ParticipantSlot[][]

      The semi final losers who will play the consolation final.

    • overrides: ConsolationFinalOverrides = {}

      Optional overrides.

    Returns Promise<void>

  • Creates a double elimination stage.

    Parameters

    Returns Promise<void>

  • Creates a double elimination stage with skip first round option.

    Parameters

    Returns Promise<void>

  • Creates a grand final (none, simple or double) for winners of both bracket in a double elimination stage.

    Parameters

    Returns Promise<undefined | Id>

  • Creates a lower bracket, alternating between major and minor rounds.

    • A major round is a regular round.
    • A minor round matches the previous (major) round's winners against upper bracket losers of the corresponding round.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupNumber: number

      Number of the group in the stage.

    • losers: ParticipantSlot[][]

      One list of losers per upper bracket round.

    Returns Promise<ParticipantSlot>

  • Creates a match, possibly with match games.

    • If childCount is 0, then there is no children. The score of the match is directly its intrinsic score.
    • If childCount is greater than 0, then the score of the match will automatically be calculated based on its child games.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupId: Id

      ID of the parent group.

    • roundId: Id

      ID of the parent round.

    • matchNumber: number

      Number in the round.

    • opponents: Duel

      The two opponents matching against each other.

    • childCount: number

      Child count for this match (number of games).

    Returns Promise<void>

  • Creates a round, which contain matches.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupId: Id

      ID of the parent group.

    • roundNumber: number

      Number in the group.

    • matchCount: number

      Duel/match count.

    • duels: Duel[]

      A list of duels.

    • matchNumberStart: number = 1

      Optionally give the starting point for the match numbers. Starts at 1 by default.

    Returns Promise<void>

  • Creates a round-robin group.

    This will make as many rounds as needed to let each participant match every other once.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupNumber: number

      Number of the group in the stage.

    • slots: ParticipantSlot[]

      A list of slots.

    Returns Promise<void>

  • Creates a standard bracket, which is the only one in single elimination and the upper one in double elimination.

    This will make as many rounds as needed to end with one winner.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupNumber: number

      Number of the group in the stage.

    • slots: ParticipantSlot[]

      A list of slots.

    Returns Promise<StandardBracketResults>

  • Creates a bracket with rounds that only have 1 match each. Used for finals.

    Parameters

    • stageId: Id

      ID of the parent stage.

    • groupNumber: number

      Number of the group in the stage.

    • duels: Duel[]

      A list of duels.

    • overrides: ConsolationFinalOverrides = {}

      Optional overrides.

    Returns Promise<Id>

  • Creates a double elimination stage.

    One upper bracket (winner bracket, WB), one lower bracket (loser bracket, LB) and optionally a grand final between the winner of both bracket, which can be simple or double.

    Returns Promise<Stage>

  • Ensures that the seed ordering list is stored even if it was not given in the first place.

    Parameters

    • stageId: Id

      ID of the stage.

    Returns Promise<void>

  • Gets the duels for the current round based on the previous one. No ordering is done, it must be done beforehand for the first round.

    Parameters

    • previousDuels: Duel[]

      Duels of the previous round.

    • currentDuelCount: number

      Count of duels (matches) in the current round.

    Returns Duel[]

  • Gets the duels for a major round in the LB. No ordering is done, it must be done beforehand for the first round.

    Parameters

    • previousDuels: Duel[]

      Duels of the previous round.

    • currentDuelCount: number

      Count of duels (matches) in the current round.

    • major: true

      Indicates that the round is a major round in the LB.

    Returns Duel[]

  • Gets the duels for a minor round in the LB. Ordering is done.

    Parameters

    • previousDuels: Duel[]

      Duels of the previous round.

    • currentDuelCount: number

      Count of duels (matches) in the current round.

    • major: false

      Indicates that the round is a minor round in the LB.

    • losers: ParticipantSlot[]

      The losers going from the WB.

    • Optional method: SeedOrdering

      The ordering method to apply to the losers.

    Returns Duel[]

  • Safely gets the only major ordering for the lower bracket.

    Parameters

    • participantCount: number

      Number of participants in the stage.

    Returns SeedOrdering

  • Safely gets matchesChildCount in the stage input settings.

    Returns number

  • Safely gets a minor ordering for the lower bracket by its index.

    Parameters

    • participantCount: number

      Number of participants in the stage.

    • index: number

      Index of the minor round.

    • minorRoundCount: number

      Number of minor rounds.

    Returns undefined | SeedOrdering

  • Safely gets an ordering by its index in the stage input settings.

    Parameters

    • orderingIndex: number

      Index of the ordering.

    • stageType: "groups" | "elimination"

      A value indicating if the method should be a group method or not.

    • defaultMethod: SeedOrdering

      The default method to use if not given.

    Returns SeedOrdering

  • Returns the ordering method for the groups in a round-robin stage.

    Returns SeedOrdering

  • Returns a list of slots.

    • If seeding was given, inserts them in the storage.
    • If size was given, only returns a list of empty slots.

    Parameters

    • Optional positions: number[]

      An optional list of positions (seeds) for a manual ordering.

    Returns Promise<ParticipantSlot[]>

  • Returns the list of slots with a seeding containing IDs. No database mutation.

    Parameters

    • seeding: Seeding

      The seeding (IDs).

    • Optional positions: number[]

      An optional list of positions (seeds) for a manual ordering.

    Returns Promise<ParticipantSlot[]>

  • Returns the list of slots with a seeding containing names. Participants may be added to database.

    Parameters

    • seeding: Seeding

      The seeding (names).

    • Optional positions: number[]

      An optional list of positions (seeds) for a manual ordering.

    Returns Promise<ParticipantSlot[]>

  • Gets the current stage number based on existing stages.

    Returns Promise<number>

  • Returns the ordering method for the first round of the upper bracket of an elimination stage.

    Returns SeedOrdering

  • Inserts a group or finds an existing one.

    Parameters

    • group: OmitId<Group>

      The group to insert.

    Returns Promise<Id>

  • Inserts a match or updates an existing one.

    Parameters

    • match: OmitId<Match>

      The match to insert.

    • existing: null | Match

      An existing match corresponding to the current one.

    Returns Promise<Id>

  • Inserts a match game or finds an existing one (and updates it).

    Parameters

    • matchGame: OmitId<MatchGame>

      The match game to insert.

    Returns Promise<Id>

  • Inserts a round or finds an existing one.

    Parameters

    • round: OmitId<Round>

      The round to insert.

    Returns Promise<Id>

  • Inserts a stage or finds an existing one.

    Parameters

    • stage: OmitId<Stage>

      The stage to insert.

    Returns Promise<Id>

  • Inserts missing participants.

    Parameters

    • participants: OmitId<Participant>[]

      The list of participants to process.

    Returns Promise<boolean>

  • Creates a round-robin stage.

    Group count must be given. It will distribute participants in groups and rounds.

    Returns Promise<Stage>

  • Enables the update mode.

    Parameters

    • stageId: Id

      ID of the stage.

    • enableByes: boolean

      Whether to use BYEs or TBDs for null values in an input seeding.

    Returns void

  • Creates a single elimination stage.

    One bracket and optionally a consolation final between semi-final losers.

    Returns Promise<Stage>

Generated using TypeDoc