|
|
|
|
@ -925,7 +925,7 @@ defer { |
|
|
|
|
let wcBracket = _teams.filter { $0.wildCardBracket }.sorted(using: _currentSelectionSorting, order: .ascending) |
|
|
|
|
|
|
|
|
|
let groupStageSpots: Int = self.groupStageSpots() |
|
|
|
|
var bracketSeeds: Int = min(teamCount, _teams.count) - groupStageSpots - wcBracket.count |
|
|
|
|
var bracketSeeds: Int = teamCount - groupStageSpots - wcBracket.count |
|
|
|
|
var groupStageTeamCount: Int = groupStageSpots - wcGroupStage.count |
|
|
|
|
if groupStageTeamCount < 0 { groupStageTeamCount = 0 } |
|
|
|
|
if bracketSeeds < 0 { bracketSeeds = 0 } |
|
|
|
|
@ -969,8 +969,8 @@ defer { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func bracketCut(teamCount: Int) -> Int { |
|
|
|
|
return max(0, teamCount - groupStageCut()) |
|
|
|
|
func bracketCut(teamCount: Int, groupStageCut: Int) -> Int { |
|
|
|
|
return self.teamCount - groupStageCut |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func groupStageCut() -> Int { |
|
|
|
|
@ -979,10 +979,12 @@ defer { |
|
|
|
|
|
|
|
|
|
func cutLabel(index: Int, teamCount: Int?) -> String { |
|
|
|
|
let _teamCount = teamCount ?? selectedSortedTeams().count |
|
|
|
|
let bracketCut = bracketCut(teamCount: _teamCount) |
|
|
|
|
let groupStageCut = groupStageCut() |
|
|
|
|
let bracketCut = bracketCut(teamCount: _teamCount, groupStageCut: groupStageCut) |
|
|
|
|
|
|
|
|
|
if index < bracketCut { |
|
|
|
|
return "Tableau" |
|
|
|
|
} else if index - bracketCut < groupStageCut() && _teamCount > 0 { |
|
|
|
|
} else if index - bracketCut < groupStageCut && _teamCount > 0 { |
|
|
|
|
return "Poule" |
|
|
|
|
} else { |
|
|
|
|
return "Attente" |
|
|
|
|
@ -992,11 +994,12 @@ defer { |
|
|
|
|
func cutLabelColor(index: Int?, teamCount: Int?) -> Color { |
|
|
|
|
guard let index else { return Color.gray } |
|
|
|
|
let _teamCount = teamCount ?? selectedSortedTeams().count |
|
|
|
|
let bracketCut = bracketCut(teamCount: _teamCount) |
|
|
|
|
let groupStageCut = groupStageCut() |
|
|
|
|
let bracketCut = bracketCut(teamCount: _teamCount, groupStageCut: groupStageCut) |
|
|
|
|
if index < bracketCut { |
|
|
|
|
return Color.mint |
|
|
|
|
} else if index - bracketCut < groupStageCut() && _teamCount > 0 { |
|
|
|
|
return Color.cyan |
|
|
|
|
} else if index - bracketCut < groupStageCut && _teamCount > 0 { |
|
|
|
|
return Color.indigo |
|
|
|
|
} else { |
|
|
|
|
return Color.gray |
|
|
|
|
} |
|
|
|
|
@ -1858,6 +1861,7 @@ defer { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
team.setWeight(from: [], inTournamentCategory: self.tournamentCategory) |
|
|
|
|
team.weight += 200_000 |
|
|
|
|
return team |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|