Update playoff station assignment to match 2018 rules.

This commit is contained in:
Patrick Fairbank
2018-08-25 15:08:36 -07:00
parent 0082ea5d0b
commit 3742e773c2
2 changed files with 5 additions and 5 deletions

View File

@@ -80,8 +80,8 @@ func buildEliminationMatchSet(database *model.Database, round int, group int, nu
}
if len(redAlliance) >= 3 {
// Swap the teams around to match the positions dictated by the 2017 rules.
redAlliance[0], redAlliance[1], redAlliance[2] = redAlliance[2], redAlliance[0], redAlliance[1]
// Swap the teams around to match the positions dictated by the rules.
redAlliance[0], redAlliance[1], redAlliance[2] = redAlliance[1], redAlliance[0], redAlliance[2]
}
}
if blueAllianceNumber <= numDirectAlliances {
@@ -95,7 +95,7 @@ func buildEliminationMatchSet(database *model.Database, round int, group int, nu
}
if len(blueAlliance) >= 3 {
// Swap the teams around to match the positions dictated by the 2017 rules.
// Swap the teams around to match the positions dictated by the rules.
blueAlliance[0], blueAlliance[1], blueAlliance[2] = blueAlliance[1], blueAlliance[0], blueAlliance[2]
}
}

View File

@@ -737,9 +737,9 @@ func TestEliminationScheduleTeamPositions(t *testing.T) {
matches, _ := database.GetMatchesByType("elimination")
match1 := matches[0]
match2 := matches[1]
assert.Equal(t, 100, match1.Red1)
assert.Equal(t, 10, match1.Red1)
assert.Equal(t, 1, match1.Red2)
assert.Equal(t, 10, match1.Red3)
assert.Equal(t, 100, match1.Red3)
assert.Equal(t, 30, match2.Blue1)
assert.Equal(t, 3, match2.Blue2)
assert.Equal(t, 300, match2.Blue3)