|
|
|
@ -1403,14 +1403,16 @@ defer { |
|
|
|
groupStages.forEach { groupStage in |
|
|
|
groupStages.forEach { groupStage in |
|
|
|
let groupStageTeams = groupStage.teams(true) |
|
|
|
let groupStageTeams = groupStage.teams(true) |
|
|
|
for (index, team) in groupStageTeams.enumerated() { |
|
|
|
for (index, team) in groupStageTeams.enumerated() { |
|
|
|
if team.qualified == false && alreadyPlaceTeams.contains(team.id) == false { |
|
|
|
if groupStage.hasEnded() { |
|
|
|
let groupStageWidth = max(((index == qualifiedPerGroupStage) ? groupStageCount - groupStageAdditionalQualified : groupStageCount) * (index - qualifiedPerGroupStage), 0) |
|
|
|
if team.qualified == false && alreadyPlaceTeams.contains(team.id) == false { |
|
|
|
|
|
|
|
let groupStageWidth = max(((index == qualifiedPerGroupStage) ? groupStageCount - groupStageAdditionalQualified : groupStageCount) * (index - qualifiedPerGroupStage), 0) |
|
|
|
let _index = baseRank + groupStageWidth + 1 - (index > qualifiedPerGroupStage ? groupStageAdditionalQualified : 0) |
|
|
|
|
|
|
|
if let existingTeams = teams[_index] { |
|
|
|
let _index = baseRank + groupStageWidth + 1 - (index > qualifiedPerGroupStage ? groupStageAdditionalQualified : 0) |
|
|
|
teams[_index] = existingTeams + [team.id] |
|
|
|
if let existingTeams = teams[_index] { |
|
|
|
} else { |
|
|
|
teams[_index] = existingTeams + [team.id] |
|
|
|
teams[_index] = [team.id] |
|
|
|
} else { |
|
|
|
|
|
|
|
teams[_index] = [team.id] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2347,10 +2349,8 @@ defer { |
|
|
|
|
|
|
|
|
|
|
|
func updateTournamentState() { |
|
|
|
func updateTournamentState() { |
|
|
|
Task { |
|
|
|
Task { |
|
|
|
if hasEnded() { |
|
|
|
let fr = await finalRanking() |
|
|
|
let fr = await finalRanking() |
|
|
|
_ = await setRankings(finalRanks: fr) |
|
|
|
_ = await setRankings(finalRanks: fr) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|