mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Added regular double elimination placing 1-8 tournament
This commit is contained in:
@@ -10,6 +10,7 @@ class SixteenManDoubleEliminationGenerateLoserNames
|
||||
conso_round_3(matches_by_weight)
|
||||
conso_round_5(matches_by_weight)
|
||||
fifth_sixth(matches_by_weight)
|
||||
seventh_eighth(matches_by_weight)
|
||||
save_matches(matches_by_weight)
|
||||
matches_by_weight = @weight.matches.reload
|
||||
advance_bye_matches_championship(matches_by_weight)
|
||||
@@ -64,6 +65,13 @@ class SixteenManDoubleEliminationGenerateLoserNames
|
||||
match.loser2_name = "Loser of #{matches.select{|m| m.bracket_position == "Conso Semis"}.second.bout_number}"
|
||||
end
|
||||
end
|
||||
|
||||
def seventh_eighth(matches)
|
||||
matches.select{|m| m.bracket_position == "7/8"}.sort_by{|m| m.bracket_position_number}.each do |match|
|
||||
match.loser1_name = "Loser of #{matches.select{|m| m.bracket_position == "Conso Quarter"}.first.bout_number}"
|
||||
match.loser2_name = "Loser of #{matches.select{|m| m.bracket_position == "Conso Quarter"}.second.bout_number}"
|
||||
end
|
||||
end
|
||||
|
||||
def advance_bye_matches_championship(matches)
|
||||
matches.select{|m| m.round == 1 and m.bracket_position == "Bracket"}.sort_by{|m| m.bracket_position_number}.each do |match|
|
||||
|
||||
@@ -58,6 +58,9 @@ class SixteenManDoubleEliminationMatchGeneration
|
||||
create_matchup(nil,nil,"1/2",1,6,weight)
|
||||
create_matchup(nil,nil,"3/4",1,6,weight)
|
||||
create_matchup(nil,nil,"5/6",1,6,weight)
|
||||
if @number_of_placers >= 8
|
||||
create_matchup(nil,nil,"7/8",1,6,weight)
|
||||
end
|
||||
end
|
||||
|
||||
def wrestler_with_seed(seed,weight)
|
||||
|
||||
@@ -20,7 +20,7 @@ class DoubleEliminationPlacementPoints
|
||||
elsif won_bracket_position_size("7/8") > 0
|
||||
return PlacementPoints.new(@number_of_placers).seventhPlace
|
||||
elsif bracket_position_size("Conso Quarter") > 0 and @number_of_placers >= 8
|
||||
return PlacementPoints.new(@number_of_placers).eigthPlace
|
||||
return PlacementPoints.new(@number_of_placers).eighthPlace
|
||||
else
|
||||
return 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user