mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-14 17:06:46 +00:00
First shot at setting placement points for a single pool
This commit is contained in:
@@ -16,6 +16,9 @@ class PoolBracketPlacementPoints
|
|||||||
if @bracket == "fourPoolsToSemi"
|
if @bracket == "fourPoolsToSemi"
|
||||||
whilePointsAreZero { @points = fourPoolsToSemi }
|
whilePointsAreZero { @points = fourPoolsToSemi }
|
||||||
end
|
end
|
||||||
|
if wrestler.weight.size <= 6 && wrestler.weight.allPoolMatchesFinished(1)
|
||||||
|
whilePointsAreZero { @points = onePool }
|
||||||
|
end
|
||||||
return @points
|
return @points
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -63,6 +66,19 @@ class PoolBracketPlacementPoints
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def onePool
|
||||||
|
poolOrder = wrestler.weight.poolOrder(1)
|
||||||
|
if wrestler == poolOrder.first
|
||||||
|
firstPlace
|
||||||
|
elsif wrestler == poolOrder.second
|
||||||
|
secondPlace
|
||||||
|
elsif wrestler == poolOrder.third
|
||||||
|
thirdPlace
|
||||||
|
elsif wrestler == poolOrder.fourth
|
||||||
|
fourthPlace
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def finalMatchPoints
|
def finalMatchPoints
|
||||||
if won_bracket_position_size("1/2") > 0
|
if won_bracket_position_size("1/2") > 0
|
||||||
return firstPlace
|
return firstPlace
|
||||||
|
|||||||
8
app/views/tournaments/_onePoolResults.html.erb
Normal file
8
app/views/tournaments/_onePoolResults.html.erb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<h5>Results</h5>
|
||||||
|
<br>
|
||||||
|
<ol>
|
||||||
|
<li><%= @weight.poolOrder(1).first.name %></li>
|
||||||
|
<li><%= @weight.poolOrder(1).second.name %></li>
|
||||||
|
<li><%= @weight.poolOrder(1).third.name %></li>
|
||||||
|
<li><%= @weight.poolOrder(1).fourth.name %></li>
|
||||||
|
</ol>
|
||||||
@@ -23,4 +23,8 @@
|
|||||||
<% if @bracketType == "fourPoolsToSemi" %>
|
<% if @bracketType == "fourPoolsToSemi" %>
|
||||||
<%= render 'fourPoolSemiBracket' %>
|
<%= render 'fourPoolSemiBracket' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<br><br>
|
||||||
|
<% if @weight.size <= 6 && @weight.allPoolMatchesFinished(1) %>
|
||||||
|
<%= render 'onePoolResults' %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
Reference in New Issue
Block a user