mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-04 22:03:49 +00:00
Added eight pools to quarter final bracket
This commit is contained in:
@@ -93,7 +93,7 @@ class Tournament < ActiveRecord::Base
|
||||
|
||||
def pool_to_bracket_weights_with_too_many_wrestlers
|
||||
if self.tournament_type == "Pool to bracket"
|
||||
weightsWithTooManyWrestlers = weights.select{|w| w.wrestlers.size > 16}
|
||||
weightsWithTooManyWrestlers = weights.select{|w| w.wrestlers.size > 24}
|
||||
if weightsWithTooManyWrestlers.size < 1
|
||||
return nil
|
||||
else
|
||||
|
||||
@@ -56,6 +56,8 @@ class Weight < ActiveRecord::Base
|
||||
self.pools = 2
|
||||
elsif (@wrestlers.size > 10) && (@wrestlers.size <= 16)
|
||||
self.pools = 4
|
||||
elsif (@wrestlers.size > 16) && (@wrestlers.size <= 24)
|
||||
self.pools = 8
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,6 +85,8 @@ class Weight < ActiveRecord::Base
|
||||
return "fourPoolsToQuarter"
|
||||
elsif self.wrestlers.size > 12 && self.wrestlers.size <= 16
|
||||
return "fourPoolsToSemi"
|
||||
elsif self.wrestlers.size > 16 && self.wrestlers.size <= 24
|
||||
return "eightPoolsToQuarter"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ class PoolBracketGeneration
|
||||
return fourPoolsToQuarter()
|
||||
elsif @pool_bracket_type == "fourPoolsToSemi"
|
||||
return fourPoolsToSemi()
|
||||
elsif @pool_bracket_type == "eightPoolsToQuarter"
|
||||
return eightPoolsToQuarter()
|
||||
end
|
||||
return []
|
||||
end
|
||||
@@ -66,6 +68,23 @@ class PoolBracketGeneration
|
||||
createMatchup("", "", "7/8", 1)
|
||||
end
|
||||
|
||||
def eightPoolsToQuarter()
|
||||
createMatchup("Winner Pool 1", "Winner Pool 8", "Quarter", 1)
|
||||
createMatchup("Winner Pool 4", "Winner Pool 5", "Quarter", 2)
|
||||
createMatchup("Winner Pool 2", "Winner Pool 7", "Quarter", 3)
|
||||
createMatchup("Winner Pool 3", "Winner Pool 6", "Quarter", 4)
|
||||
next_round
|
||||
createMatchup("", "", "Semis", 1)
|
||||
createMatchup("", "", "Semis", 2)
|
||||
createMatchup("", "", "Conso Semis", 1)
|
||||
createMatchup("", "", "Conso Semis", 2)
|
||||
next_round
|
||||
createMatchup("", "", "1/2", 1)
|
||||
createMatchup("", "", "3/4", 1)
|
||||
createMatchup("", "", "5/6", 1)
|
||||
createMatchup("", "", "7/8", 1)
|
||||
end
|
||||
|
||||
def createMatchup(w1_name, w2_name, bracket_position, bracket_position_number)
|
||||
@tournament.matches.create(
|
||||
loser1_name: w1_name,
|
||||
|
||||
@@ -7,7 +7,7 @@ class PoolToBracketGenerateLoserNames
|
||||
matches_by_weight = @tournament.matches.where(weight_id: weight.id)
|
||||
if weight.pool_bracket_type == "twoPoolsToSemi"
|
||||
twoPoolsToSemiLoser(matches_by_weight)
|
||||
elsif weight.pool_bracket_type == "fourPoolsToQuarter"
|
||||
elsif (weight.pool_bracket_type == "fourPoolsToQuarter") or (weight.pool_bracket_type == "eightPoolsToQuarter")
|
||||
fourPoolsToQuarterLoser(matches_by_weight)
|
||||
elsif weight.pool_bracket_type == "fourPoolsToSemi"
|
||||
fourPoolsToSemiLoser(matches_by_weight)
|
||||
@@ -20,8 +20,8 @@ class PoolToBracketGenerateLoserNames
|
||||
@tournament.weights.each do |w|
|
||||
matches_by_weight = @tournament.matches.where(weight_id: w.id)
|
||||
if w.pool_bracket_type == "twoPoolsToSemi"
|
||||
twoPoolsToSemiLoser(matches_by_weight)
|
||||
elsif w.pool_bracket_type == "fourPoolsToQuarter"
|
||||
twoPoolsToSemiLoser(matches_by_weight)
|
||||
elsif (w.pool_bracket_type == "fourPoolsToQuarter") or (w.pool_bracket_type == "eightPoolsToQuarter")
|
||||
fourPoolsToQuarterLoser(matches_by_weight)
|
||||
elsif w.pool_bracket_type == "fourPoolsToSemi"
|
||||
fourPoolsToSemiLoser(matches_by_weight)
|
||||
|
||||
@@ -10,6 +10,8 @@ class GeneratePoolNumbers
|
||||
saveTwoPoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
elsif @weight.pools == 1
|
||||
saveOnePoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
elsif @weight.pools == 8
|
||||
saveEightPoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,4 +76,35 @@ class GeneratePoolNumbers
|
||||
w.save
|
||||
end
|
||||
end
|
||||
|
||||
def saveEightPoolNumbers(poolWrestlers)
|
||||
pool = 1
|
||||
poolWrestlers.sort_by{|x| x.bracket_line }.reverse.each do |w|
|
||||
if w.bracket_line == 1
|
||||
w.pool = 1
|
||||
elsif w.bracket_line == 2
|
||||
w.pool = 2
|
||||
elsif w.bracket_line == 3
|
||||
w.pool = 3
|
||||
elsif w.bracket_line == 4
|
||||
w.pool = 4
|
||||
elsif w.bracket_line == 5
|
||||
w.pool = 5
|
||||
elsif w.bracket_line == 6
|
||||
w.pool = 6
|
||||
elsif w.bracket_line == 7
|
||||
w.pool = 7
|
||||
elsif w.bracket_line == 8
|
||||
w.pool = 8
|
||||
else
|
||||
w.pool = pool
|
||||
end
|
||||
if pool < 8
|
||||
pool = pool + 1
|
||||
else
|
||||
pool = 1
|
||||
end
|
||||
w.save
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@ class PoolBracketPlacementPoints
|
||||
if @bracket == "twoPoolsToSemi"
|
||||
whilePointsAreZero { @points = twoPoolsToSemi }
|
||||
end
|
||||
if @bracket == "fourPoolsToQuarter"
|
||||
if (@bracket == "fourPoolsToQuarter") or (@bracket == "eightPoolsToQuarter")
|
||||
whilePointsAreZero { @points = fourPoolsToQuarter }
|
||||
end
|
||||
if @bracket == "fourPoolsToSemi"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<br>
|
||||
<h4>Features</h4>
|
||||
<br>
|
||||
<p>At this moment in time, WrestlingDev supports a pool to bracket type tournament for up to 16 teams. The bracket format follows OHSAA's 5 match per day rule. WrestlingDev will automatically generate brackets, generate bout numbers, generate and update a bout board, track team points, and update brackets.</p>
|
||||
<p>At this moment in time, WrestlingDev supports a pool to bracket type tournament for up to 24 wrestlers per weight. The bracket format follows OHSAA's 5 match per day rule. WrestlingDev will automatically generate brackets, generate bout numbers, generate and update a bout board, track team points, and update brackets.</p>
|
||||
<p>For pool to bracket tournaments, pool tie breakers are the following:</p>
|
||||
<ul>
|
||||
<li>Least team points deducted</li>
|
||||
@@ -38,9 +38,19 @@
|
||||
</ul>
|
||||
<p>Finals matches will only recieve extra placement points for placing higher and bonus points for pin, tech, major, etc. Please note, only brackets with four pools place up to 8. Brackets with 1 or 2 pools only place top 4.</p>
|
||||
<br>
|
||||
<h4>Pool Types</h4>
|
||||
<ul>
|
||||
<li>Single pool round robin - 2-5 wrestlers, place 1-4.</li>
|
||||
<li>Two Pools of 4 (3 matches each) to a semi final bracket - 6-8 wrestlers, place 1-4.</li>
|
||||
<li>Two Pools of 5 (4 matches each) to a championship and 3rd/4th match - 8-10 wrestlers, place 1-4.</li>
|
||||
<li>Four pools of 3 (2 matches each) to a quarter final bracket - 9-12 wrestlers, place 1-8.</li>
|
||||
<li>Four pools of 4 (3 matches each) to a semi final bracket - 13-16 wrestlers, place 1-8.</li>
|
||||
<li>Eight pools of 3 (2 matches each) to a quarter final bracket - 17-24 wrestlers, place 1-8.</li>
|
||||
</ul>
|
||||
<br>
|
||||
<h4>Future Plans</h4>
|
||||
<br>
|
||||
<p>Future development plans to support normal double elimination brackets are underway and are planned to be finished in time for the 2016-2017 wrestling season.</p>
|
||||
<p>Future development plans to support normal double elimination brackets are underway.</p>
|
||||
<br>
|
||||
<h4>Contact</h4>
|
||||
<br>
|
||||
|
||||
@@ -86,7 +86,7 @@ li:first-child,li:last-child {
|
||||
<% if w.pool_bracket_type == "twoPoolsToSemi" %>
|
||||
<%= render 'twoPoolSemiBracket' %>
|
||||
<% end %>
|
||||
<% if w.pool_bracket_type == "fourPoolsToQuarter" %>
|
||||
<% if w.pool_bracket_type == "fourPoolsToQuarter" or w.pool_bracket_type == "eightPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if w.pool_bracket_type == "fourPoolsToSemi" %>
|
||||
|
||||
@@ -80,6 +80,9 @@ li:first-child,li:last-child {
|
||||
<% if @weight.pool_bracket_type == "fourPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if @weight.pool_bracket_type == "eightPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if @weight.pool_bracket_type == "fourPoolsToSemi" %>
|
||||
<%= render 'fourPoolSemiBracket' %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user