mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 05:36:45 -04:00
Update double-elimination bracket to match 2023 rules.
This commit is contained in:
@@ -34,15 +34,15 @@ var doubleEliminationBracketMatchupTemplates = []matchupTemplate{
|
||||
matchupKey: newMatchupKey(1, 3),
|
||||
displayName: "3",
|
||||
NumWinsToAdvance: 1,
|
||||
redAllianceSource: allianceSource{allianceId: 3},
|
||||
blueAllianceSource: allianceSource{allianceId: 6},
|
||||
redAllianceSource: allianceSource{allianceId: 2},
|
||||
blueAllianceSource: allianceSource{allianceId: 7},
|
||||
},
|
||||
{
|
||||
matchupKey: newMatchupKey(1, 4),
|
||||
displayName: "4",
|
||||
NumWinsToAdvance: 1,
|
||||
redAllianceSource: allianceSource{allianceId: 2},
|
||||
blueAllianceSource: allianceSource{allianceId: 7},
|
||||
redAllianceSource: allianceSource{allianceId: 3},
|
||||
blueAllianceSource: allianceSource{allianceId: 6},
|
||||
},
|
||||
{
|
||||
matchupKey: newMatchupKey(2, 1),
|
||||
@@ -90,28 +90,28 @@ var doubleEliminationBracketMatchupTemplates = []matchupTemplate{
|
||||
matchupKey: newMatchupKey(4, 1),
|
||||
displayName: "11",
|
||||
NumWinsToAdvance: 1,
|
||||
redAllianceSource: newWinnerAllianceSource(3, 2),
|
||||
blueAllianceSource: newWinnerAllianceSource(3, 1),
|
||||
redAllianceSource: newWinnerAllianceSource(2, 3),
|
||||
blueAllianceSource: newWinnerAllianceSource(2, 4),
|
||||
},
|
||||
{
|
||||
matchupKey: newMatchupKey(4, 2),
|
||||
displayName: "12",
|
||||
NumWinsToAdvance: 1,
|
||||
redAllianceSource: newWinnerAllianceSource(2, 3),
|
||||
blueAllianceSource: newWinnerAllianceSource(2, 4),
|
||||
redAllianceSource: newWinnerAllianceSource(3, 2),
|
||||
blueAllianceSource: newWinnerAllianceSource(3, 1),
|
||||
},
|
||||
{
|
||||
matchupKey: newMatchupKey(5, 1),
|
||||
displayName: "13",
|
||||
NumWinsToAdvance: 1,
|
||||
redAllianceSource: newLoserAllianceSource(4, 2),
|
||||
blueAllianceSource: newWinnerAllianceSource(4, 1),
|
||||
redAllianceSource: newLoserAllianceSource(4, 1),
|
||||
blueAllianceSource: newWinnerAllianceSource(4, 2),
|
||||
},
|
||||
{
|
||||
matchupKey: newMatchupKey(6, 1),
|
||||
displayName: "F",
|
||||
NumWinsToAdvance: 2,
|
||||
redAllianceSource: newWinnerAllianceSource(4, 2),
|
||||
redAllianceSource: newWinnerAllianceSource(4, 1),
|
||||
blueAllianceSource: newWinnerAllianceSource(5, 1),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ func TestDoubleEliminationInitial(t *testing.T) {
|
||||
if assert.Equal(t, 4, len(matches)) {
|
||||
assertMatch(t, matches[0], "1", 1, 8)
|
||||
assertMatch(t, matches[1], "2", 4, 5)
|
||||
assertMatch(t, matches[2], "3", 3, 6)
|
||||
assertMatch(t, matches[3], "4", 2, 7)
|
||||
assertMatch(t, matches[2], "3", 2, 7)
|
||||
assertMatch(t, matches[3], "4", 3, 6)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,21 +65,21 @@ func TestDoubleEliminationProgression(t *testing.T) {
|
||||
assertMatch(t, matches[5], "7", 8, 4)
|
||||
}
|
||||
|
||||
scoreMatch(database, "3", game.RedWonMatch)
|
||||
scoreMatch(database, "3", game.BlueWonMatch)
|
||||
assert.Nil(t, bracket.Update(database, &dummyStartTime))
|
||||
matches, err = database.GetMatchesByType("elimination")
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 6, len(matches))
|
||||
|
||||
scoreMatch(database, "4", game.BlueWonMatch)
|
||||
scoreMatch(database, "4", game.RedWonMatch)
|
||||
assert.Nil(t, bracket.Update(database, &dummyStartTime))
|
||||
matches, err = database.GetMatchesByType("elimination")
|
||||
assert.Nil(t, err)
|
||||
if assert.Equal(t, 8, len(matches)) {
|
||||
assertMatch(t, matches[4], "5", 1, 5)
|
||||
assertMatch(t, matches[5], "6", 6, 2)
|
||||
assertMatch(t, matches[5], "6", 2, 6)
|
||||
assertMatch(t, matches[6], "7", 8, 4)
|
||||
assertMatch(t, matches[7], "8", 3, 7)
|
||||
assertMatch(t, matches[7], "8", 7, 3)
|
||||
}
|
||||
|
||||
scoreMatch(database, "5", game.BlueWonMatch)
|
||||
@@ -88,7 +88,7 @@ func TestDoubleEliminationProgression(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 8, len(matches))
|
||||
|
||||
scoreMatch(database, "6", game.BlueWonMatch)
|
||||
scoreMatch(database, "6", game.RedWonMatch)
|
||||
assert.Nil(t, bracket.Update(database, &dummyStartTime))
|
||||
matches, err = database.GetMatchesByType("elimination")
|
||||
assert.Nil(t, err)
|
||||
@@ -102,13 +102,13 @@ func TestDoubleEliminationProgression(t *testing.T) {
|
||||
assertMatch(t, matches[8], "9", 8, 2)
|
||||
}
|
||||
|
||||
scoreMatch(database, "8", game.RedWonMatch)
|
||||
scoreMatch(database, "8", game.BlueWonMatch)
|
||||
assert.Nil(t, bracket.Update(database, &dummyStartTime))
|
||||
matches, err = database.GetMatchesByType("elimination")
|
||||
assert.Nil(t, err)
|
||||
if assert.Equal(t, 11, len(matches)) {
|
||||
assertMatch(t, matches[9], "10", 7, 5)
|
||||
assertMatch(t, matches[10], "12", 4, 3)
|
||||
assertMatch(t, matches[10], "11", 4, 3)
|
||||
}
|
||||
|
||||
scoreMatch(database, "9", game.RedWonMatch)
|
||||
@@ -122,8 +122,8 @@ func TestDoubleEliminationProgression(t *testing.T) {
|
||||
matches, err = database.GetMatchesByType("elimination")
|
||||
assert.Nil(t, err)
|
||||
if assert.Equal(t, 12, len(matches)) {
|
||||
assertMatch(t, matches[10], "11", 7, 8)
|
||||
assertMatch(t, matches[11], "12", 4, 3)
|
||||
assertMatch(t, matches[10], "11", 4, 3)
|
||||
assertMatch(t, matches[11], "12", 7, 8)
|
||||
}
|
||||
|
||||
scoreMatch(database, "11", game.RedWonMatch)
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestMatchupDisplayNames(t *testing.T) {
|
||||
|
||||
assert.Equal(t, "Finals", bracket.FinalsMatchup.LongDisplayName())
|
||||
assert.Equal(t, "F-1", bracket.FinalsMatchup.matchDisplayName(1))
|
||||
assert.Equal(t, "W 12", bracket.FinalsMatchup.RedAllianceSourceDisplayName())
|
||||
assert.Equal(t, "W 11", bracket.FinalsMatchup.RedAllianceSourceDisplayName())
|
||||
assert.Equal(t, "W 13", bracket.FinalsMatchup.BlueAllianceSourceDisplayName())
|
||||
|
||||
match13, err := bracket.GetMatchup(5, 1)
|
||||
@@ -25,8 +25,8 @@ func TestMatchupDisplayNames(t *testing.T) {
|
||||
assert.Equal(t, "Match 13", match13.LongDisplayName())
|
||||
assert.Equal(t, "13", match13.matchDisplayName(1))
|
||||
assert.Equal(t, "13-2", match13.matchDisplayName(2))
|
||||
assert.Equal(t, "L 12", match13.RedAllianceSourceDisplayName())
|
||||
assert.Equal(t, "W 11", match13.BlueAllianceSourceDisplayName())
|
||||
assert.Equal(t, "L 11", match13.RedAllianceSourceDisplayName())
|
||||
assert.Equal(t, "W 12", match13.BlueAllianceSourceDisplayName())
|
||||
|
||||
bracket, err = NewSingleEliminationBracket(8)
|
||||
assert.Nil(t, err)
|
||||
|
||||
@@ -211,8 +211,8 @@
|
||||
.bracket_double #match_3_2 {transform: translate(709px, 504px);}
|
||||
.bracket_double #match_3_1 {transform: translate(709px, 694px);}
|
||||
|
||||
.bracket_double #match_4_2 {transform: translate(1006px, 301px);}
|
||||
.bracket_double #match_4_1 {transform: translate(1006px, 599px);}
|
||||
.bracket_double #match_4_1 {transform: translate(1006px, 301px);}
|
||||
.bracket_double #match_4_2 {transform: translate(1006px, 599px);}
|
||||
|
||||
.bracket_double #match_5_1 {transform: translate(1302px, 567px);}
|
||||
|
||||
@@ -375,6 +375,16 @@
|
||||
<text transform="translate(640.2857 472.1667)" class="loser">L</text>
|
||||
</g>
|
||||
<g id="connectors_4_1"{{if (index .Matchups "4_1").IsActive}} class="active"{{end}}>
|
||||
<rect class="coverup" x="699.216" y="241.054" width="312.117" height="199.156"/>
|
||||
<polyline points="698,247 790,247 790,358 1010,358"/>
|
||||
<polyline points="698,437 790,437 790,421 1010,421"/>
|
||||
<text transform="translate(628.5344 429.1004)">W</text>
|
||||
<text transform="translate(628.5344 239.1004)">W</text>
|
||||
<text transform="translate(1263.0288 382.2166)">W</text>
|
||||
<text transform="translate(1239.3726 418.7044)" class="loser">L</text>
|
||||
<polyline class="loser" points="1256,391 1256,625 1323,625"/>
|
||||
</g>
|
||||
<g id="connectors_4_2"{{if (index .Matchups "4_2").IsActive}} class="active"{{end}}>
|
||||
<rect class="coverup" x="955.326" y="589.109" width="68.612" height="200.486"/>
|
||||
<text transform="translate(1223.2803 681.0883)">W</text>
|
||||
<text transform="translate(1223.3726 717.1893)" class="loser">L</text>
|
||||
@@ -386,16 +396,6 @@
|
||||
<polyline points="955,593 955,655 1008,655"/>
|
||||
<polyline points="955,783 955,725 1008,725"/>
|
||||
</g>
|
||||
<g id="connectors_4_2"{{if (index .Matchups "4_2").IsActive}} class="active"{{end}}>
|
||||
<rect class="coverup" x="699.216" y="241.054" width="312.117" height="199.156"/>
|
||||
<polyline points="698,247 790,247 790,358 1010,358"/>
|
||||
<polyline points="698,437 790,437 790,421 1010,421"/>
|
||||
<text transform="translate(628.5344 429.1004)">W</text>
|
||||
<text transform="translate(628.5344 239.1004)">W</text>
|
||||
<text transform="translate(1263.0288 382.2166)">W</text>
|
||||
<text transform="translate(1239.3726 418.7044)" class="loser">L</text>
|
||||
<polyline class="loser" points="1256,391 1256,625 1323,625"/>
|
||||
</g>
|
||||
<g id="connectors_5_1"{{if (index .Matchups "5_1").IsActive}} class="active"{{end}}>
|
||||
<rect class="coverup" x="1523.794" y="381.275" width="83.494" height="287.877"/>
|
||||
<polyline points="1481,390 1553,390 1553,474 1633,474"/>
|
||||
|
||||
Reference in New Issue
Block a user