|
|
|
|
@ -626,16 +626,20 @@ final class MatchScheduler : ModelObject, Storable { |
|
|
|
|
|
|
|
|
|
var rounds = [Round]() |
|
|
|
|
|
|
|
|
|
if let groupStageLoserBracketRound = tournament.groupStageLoserBracket() { |
|
|
|
|
rounds.append(groupStageLoserBracketRound) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if shouldEndRoundBeforeStartingNext { |
|
|
|
|
rounds = upperRounds.flatMap { |
|
|
|
|
rounds.append(contentsOf: upperRounds.flatMap { |
|
|
|
|
[$0] + $0.loserRoundsAndChildren() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
rounds = upperRounds.map { |
|
|
|
|
rounds.append(contentsOf: upperRounds.map { |
|
|
|
|
$0 |
|
|
|
|
} + upperRounds.flatMap { |
|
|
|
|
$0.loserRoundsAndChildren() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let flattenedMatches = rounds.flatMap { round in |
|
|
|
|
|