View Source ExTournaments.Pairings.DoubleElimination.FlowTypes.BuildTypeOneFlow (ExTournaments v0.5.1)

Module for building matches flow in the upper bracket when number of participant is power of 2

Link to this section Summary

Functions

Takes existing list of %ExTournaments.Match{} structs, indices of the round in the upper and lower bracket, difference between this indices, remainder and exponent from the difference between number of participants and power of 2.

Link to this section Functions

Link to this function

call(matches, win_round, lose_round, fill_count, round_diff, exponent, remainder)

View Source
@spec call(
  [ExTournaments.Match.t()],
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer(),
  integer(),
  number(),
  number()
) :: %{
  fill_count: non_neg_integer(),
  lose_round: non_neg_integer(),
  matches: [ExTournaments.Match.t()],
  win_round: non_neg_integer()
}

Takes existing list of %ExTournaments.Match{} structs, indices of the round in the upper and lower bracket, difference between this indices, remainder and exponent from the difference between number of participants and power of 2.

It will populate flow for the case when remainder is equal 0 which means number of participants is equal the power of 2.

Returns list of %ExTournaments.Match{} structs with updated values for next matches after win or loss in the upper bracket.