File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,9 +33,19 @@ const generateStructure = (count: number): Round[] => {
3333 const matchesPerRound = Math . ceil ( count / 2 ) ;
3434
3535 // Dynamic Swiss Rounds Count
36- // 7-10 teams: 4 Rounds
37- // 11+ teams: 5 Rounds
38- const swissRoundsCount = count <= 10 ? 4 : 5 ;
36+ let swissRoundsCount = 5 ;
37+ let hasTiebreaker = false ;
38+
39+ if ( count <= 9 ) {
40+ swissRoundsCount = 4 ;
41+ } else if ( count === 10 ) {
42+ // 10 Teams: 4 Swiss Rounds + Tiebreaker Round
43+ swissRoundsCount = 4 ;
44+ hasTiebreaker = true ;
45+ } else {
46+ // 11+ Teams: 5 Swiss Rounds
47+ swissRoundsCount = 5 ;
48+ }
3949
4050 for ( let i = 1 ; i <= swissRoundsCount ; i ++ ) {
4151 rounds . push ( {
@@ -45,6 +55,15 @@ const generateStructure = (count: number): Round[] => {
4555 } ) ;
4656 }
4757
58+ // Tiebreaker Round (Specific for 10 teams or custom config)
59+ if ( hasTiebreaker ) {
60+ rounds . push ( {
61+ name : "Desempate" ,
62+ matches : createTBDMatches ( 2 ) , // 2 slots for potential tiebreakers
63+ toBeDetermined : true
64+ } ) ;
65+ }
66+
4867 // Dynamic Playoffs
4968 if ( count <= 9 ) {
5069 // Top 6 Format (Byes for Top 2)
You can’t perform that action at this time.
0 commit comments