1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-10 07:37:25 +00:00

Fixed double elim bracket views, fixed double elim match generation and loser name generation for 4 man bracket, fixed seed page submission and added tests, added tests for tournament generation errors and added a new error for assigning a seed higher than the number of wrestlers.

This commit is contained in:
2024-12-08 19:29:56 -05:00
parent f6ef471591
commit f18802a933
10 changed files with 278 additions and 37 deletions

View File

@@ -19,6 +19,12 @@ class DoubleEliminationMatchGeneration
# consolation_rounds define [round_number, number_of_matches_in_round, bracket_position]
case bracket_size
when 4 then
return BracketMatchups.new(
[[1, 4, "Semis"], [2, 3, "Semis"]],
[[2, 1, "1/2"]],
[[2, 1, "3/4"]]
)
when 8 then
return BracketMatchups.new(
[[1, 8, "Quarter"], [4, 5, "Quarter"], [3, 6, "Quarter"], [2, 7, "Quarter"]],
@@ -75,8 +81,12 @@ class DoubleEliminationMatchGeneration
matches_this_round.times do |bracket_position_number|
create_matchup(nil, nil, bracket_position, bracket_position_number + 1, round, weight)
end
create_matchup(nil, nil, "5/6", 1, round, weight) if @tournament.number_of_placers >= 6 && matches_this_round == 1
create_matchup(nil, nil, "7/8", 1, round, weight) if @tournament.number_of_placers >= 8 && matches_this_round == 1
if weight.wrestlers.size >=5
create_matchup(nil, nil, "5/6", 1, round, weight) if @tournament.number_of_placers >= 6 && matches_this_round == 1
end
if weight.wrestlers.size >= 7
create_matchup(nil, nil, "7/8", 1, round, weight) if @tournament.number_of_placers >= 8 && matches_this_round == 1
end
end
end