From 3742e773c26b6da0d53a2f832a666ebba8030eb1 Mon Sep 17 00:00:00 2001 From: Patrick Fairbank Date: Sat, 25 Aug 2018 15:08:36 -0700 Subject: [PATCH] Update playoff station assignment to match 2018 rules. --- tournament/elimination_schedule.go | 6 +++--- tournament/elimination_schedule_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tournament/elimination_schedule.go b/tournament/elimination_schedule.go index 880f3c8..9c0bff0 100644 --- a/tournament/elimination_schedule.go +++ b/tournament/elimination_schedule.go @@ -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] } } diff --git a/tournament/elimination_schedule_test.go b/tournament/elimination_schedule_test.go index 38aaff6..da43f0f 100644 --- a/tournament/elimination_schedule_test.go +++ b/tournament/elimination_schedule_test.go @@ -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)