|
|
|
|
@ -517,7 +517,7 @@ defer { |
|
|
|
|
return (groupStageObject.index + 1) * 100 + groupStageObject.indexOf(index) |
|
|
|
|
} |
|
|
|
|
guard let roundObject else { return index } |
|
|
|
|
return roundObject.isLoserBracket() ? (roundObject.index + 1) * 10000 + indexInRound() : (roundObject.index + 1) * 1000 + indexInRound() |
|
|
|
|
return (300 - (roundObject.theoryCumulativeMatchCount * 10 + roundObject.index * 22)) * 10 + indexInRound() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func previousMatches() -> [Match] { |
|
|
|
|
@ -540,8 +540,10 @@ defer { |
|
|
|
|
func setWalkOut(_ teamPosition: TeamPosition) { |
|
|
|
|
let teamScoreWalkout = teamScore(teamPosition) ?? TeamScore(match: id, team: team(teamPosition)) |
|
|
|
|
teamScoreWalkout.walkOut = 0 |
|
|
|
|
teamScoreWalkout.score = matchFormat.defaultWalkOutScore(true).compactMap({ String($0) }).joined(separator: ",") |
|
|
|
|
let teamScoreWinning = teamScore(teamPosition.otherTeam) ?? TeamScore(match: id, team: team(teamPosition.otherTeam)) |
|
|
|
|
teamScoreWinning.walkOut = nil |
|
|
|
|
teamScoreWinning.score = matchFormat.defaultWalkOutScore(false).compactMap({ String($0) }).joined(separator: ",") |
|
|
|
|
do { |
|
|
|
|
try self.tournamentStore.teamScores.addOrUpdate(contentOfs: [teamScoreWalkout, teamScoreWinning]) |
|
|
|
|
} catch { |
|
|
|
|
|