|
|
|
@ -1485,7 +1485,7 @@ defer { |
|
|
|
let matchCount = RoundRule.numberOfMatches(forTeams: minimalBracketTeamCount ?? bracketTeamCount()) |
|
|
|
let matchCount = RoundRule.numberOfMatches(forTeams: minimalBracketTeamCount ?? bracketTeamCount()) |
|
|
|
|
|
|
|
|
|
|
|
let rounds = (0..<roundCount).map { //index 0 is the final |
|
|
|
let rounds = (0..<roundCount).map { //index 0 is the final |
|
|
|
return Round(tournament: id, index: $0, format: matchFormat, loserBracketMode: loserBracketMode) |
|
|
|
return Round(tournament: id, index: $0, format: roundSmartMatchFormat($0), loserBracketMode: loserBracketMode) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if rounds.isEmpty { |
|
|
|
if rounds.isEmpty { |
|
|
|
@ -1684,9 +1684,9 @@ defer { |
|
|
|
set { |
|
|
|
set { |
|
|
|
federalLevelCategory = newValue |
|
|
|
federalLevelCategory = newValue |
|
|
|
teamSorting = newValue.defaultTeamSortingType |
|
|
|
teamSorting = newValue.defaultTeamSortingType |
|
|
|
groupStageMatchFormat = groupStageSmartMatchFormat() |
|
|
|
groupStageMatchFormat = DataStore.shared.user.groupStageMatchFormatPreference ?? groupStageSmartMatchFormat() |
|
|
|
loserBracketMatchFormat = loserBracketSmartMatchFormat(1) |
|
|
|
loserBracketMatchFormat = DataStore.shared.user.loserBracketMatchFormatPreference ?? loserBracketSmartMatchFormat() |
|
|
|
matchFormat = roundSmartMatchFormat(5) |
|
|
|
matchFormat = DataStore.shared.user.bracketMatchFormatPreference ?? roundSmartMatchFormat(5) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1699,8 +1699,8 @@ defer { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public func loserBracketSmartMatchFormat(_ roundIndex: Int) -> MatchFormat { |
|
|
|
public func loserBracketSmartMatchFormat() -> MatchFormat { |
|
|
|
let format = tournamentLevel.federalFormatForLoserBracketRound(roundIndex) |
|
|
|
let format = tournamentLevel.federalFormatForLoserBracketRound() |
|
|
|
if tournamentLevel == .p25 { return .superTie } |
|
|
|
if tournamentLevel == .p25 { return .superTie } |
|
|
|
if format.rank < loserBracketMatchFormat.rank { |
|
|
|
if format.rank < loserBracketMatchFormat.rank { |
|
|
|
return format |
|
|
|
return format |
|
|
|
@ -1732,9 +1732,9 @@ defer { |
|
|
|
|
|
|
|
|
|
|
|
public func setupFederalSettings() { |
|
|
|
public func setupFederalSettings() { |
|
|
|
teamSorting = tournamentLevel.defaultTeamSortingType |
|
|
|
teamSorting = tournamentLevel.defaultTeamSortingType |
|
|
|
groupStageMatchFormat = groupStageSmartMatchFormat() |
|
|
|
groupStageMatchFormat = DataStore.shared.user.groupStageMatchFormatPreference ?? groupStageSmartMatchFormat() |
|
|
|
loserBracketMatchFormat = loserBracketSmartMatchFormat(5) |
|
|
|
loserBracketMatchFormat = DataStore.shared.user.loserBracketMatchFormatPreference ?? loserBracketSmartMatchFormat() |
|
|
|
matchFormat = roundSmartMatchFormat(5) |
|
|
|
matchFormat = DataStore.shared.user.bracketMatchFormatPreference ?? roundSmartMatchFormat(5) |
|
|
|
entryFee = tournamentLevel.entryFee |
|
|
|
entryFee = tournamentLevel.entryFee |
|
|
|
registrationDateLimit = deadline(for: .inscription) |
|
|
|
registrationDateLimit = deadline(for: .inscription) |
|
|
|
if enableOnlineRegistration, isAnimation() == false { |
|
|
|
if enableOnlineRegistration, isAnimation() == false { |
|
|
|
|