1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Pool wins are worth 2pts

This commit is contained in:
2016-01-06 20:08:28 +00:00
parent 6a5e0817d6
commit 4310a7bb42
3 changed files with 9 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ class Wrestler < ActiveRecord::Base
def teamPointsEarned def teamPointsEarned
points = 0.0 points = 0.0
points = points + (poolWins.size * 1) + (pinWins.size * 2) + (techWins.size * 1.5) + (majorWins.size * 1) + placementPoints points = points + (poolWins.size * 2) + (pinWins.size * 2) + (techWins.size * 1.5) + (majorWins.size * 1) + placementPoints
end end
def placementPoints def placementPoints

View File

@@ -20,7 +20,7 @@
<p>If three wrestlers are tied, they will be put through this sequence until two wrestlers are left. Once two wrestlers are left, the pool runner up will be decided by head to head.</p> <p>If three wrestlers are tied, they will be put through this sequence until two wrestlers are left. Once two wrestlers are left, the pool runner up will be decided by head to head.</p>
<p>For pool to bracket tournaments, team points will be calculated as follows:</p> <p>For pool to bracket tournaments, team points will be calculated as follows:</p>
<ul> <ul>
<li>Pool win: 1pt</li> <li>Pool win: 2pt</li>
<li>Win by major: 1pt extra</li> <li>Win by major: 1pt extra</li>
<li>Win by tech fall: 1.5pt extra</li> <li>Win by tech fall: 1.5pt extra</li>
<li>Win by fall, default, dq: 2pt extra</li> <li>Win by fall, default, dq: 2pt extra</li>

View File

@@ -424,9 +424,9 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
wrestler2 = Wrestler.where("name = ?", "Guy3").first wrestler2 = Wrestler.where("name = ?", "Guy3").first
#Won four in pool #Won four in pool
assert_equal 16, wrestler1.totalTeamPoints assert_equal 20, wrestler1.totalTeamPoints
#Won two in pool but was deducted a point #Won two in pool but was deducted a point
assert_equal 13, wrestler2.totalTeamPoints assert_equal 15, wrestler2.totalTeamPoints
end end
test "advancement points 1/2" do test "advancement points 1/2" do
@@ -488,25 +488,25 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
test "bonus points major" do test "bonus points major" do
endMatchWithMajor(2002,"Guy2",@matches) endMatchWithMajor(2002,"Guy2",@matches)
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 2, wrestler1.teamPointsEarned assert_equal 3, wrestler1.teamPointsEarned
end end
test "bonus points pin" do test "bonus points pin" do
endMatchWithPin(2002,"Guy2",@matches) endMatchWithPin(2002,"Guy2",@matches)
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 3, wrestler1.teamPointsEarned assert_equal 4, wrestler1.teamPointsEarned
end end
test "bonus points tech fall" do test "bonus points tech fall" do
endMatchWithTech(2002,"Guy2",@matches) endMatchWithTech(2002,"Guy2",@matches)
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 2.5, wrestler1.teamPointsEarned assert_equal 3.5, wrestler1.teamPointsEarned
end end
test "pool team points win" do test "pool team points win" do
endMatch(2002,"Guy2",@matches) endMatch(2002,"Guy2",@matches)
wrestler1 = Wrestler.where("name = ?", "Guy2").first wrestler1 = Wrestler.where("name = ?", "Guy2").first
assert_equal 1, wrestler1.teamPointsEarned assert_equal 2, wrestler1.teamPointsEarned
end end
test "advancement points fourPoolsToQuarter Quarter" do test "advancement points fourPoolsToQuarter Quarter" do
@@ -552,7 +552,7 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
wrestler = Wrestler.where("name = ?", "Guy22").first wrestler = Wrestler.where("name = ?", "Guy22").first
assert_equal 0, wrestler.totalTeamPoints assert_equal 0, wrestler.totalTeamPoints
assert_equal 1, wrestler.teamPointsEarned assert_equal 2, wrestler.teamPointsEarned
end end