|
|
|
@ -1525,7 +1525,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
|
|
|
|
|
|
|
func loserBracketSmartMatchFormat(_ roundIndex: Int) -> MatchFormat { |
|
|
|
func loserBracketSmartMatchFormat(_ roundIndex: Int) -> MatchFormat { |
|
|
|
let format = tournamentLevel.federalFormatForLoserBracketRound(roundIndex) |
|
|
|
let format = tournamentLevel.federalFormatForLoserBracketRound(roundIndex) |
|
|
|
if loserBracketMatchFormat.rank > format.rank { |
|
|
|
if format.rank > loserBracketMatchFormat.rank { |
|
|
|
return format |
|
|
|
return format |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return loserBracketMatchFormat |
|
|
|
return loserBracketMatchFormat |
|
|
|
@ -1534,7 +1534,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
|
|
|
|
|
|
|
func groupStageSmartMatchFormat() -> MatchFormat { |
|
|
|
func groupStageSmartMatchFormat() -> MatchFormat { |
|
|
|
let format = tournamentLevel.federalFormatForGroupStage() |
|
|
|
let format = tournamentLevel.federalFormatForGroupStage() |
|
|
|
if groupStageMatchFormat.rank > format.rank { |
|
|
|
if format.rank > groupStageMatchFormat.rank { |
|
|
|
return format |
|
|
|
return format |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return groupStageMatchFormat |
|
|
|
return groupStageMatchFormat |
|
|
|
@ -1550,7 +1550,7 @@ class Tournament : ModelObject, Storable { |
|
|
|
|
|
|
|
|
|
|
|
func roundSmartMatchFormat(_ roundIndex: Int) -> MatchFormat { |
|
|
|
func roundSmartMatchFormat(_ roundIndex: Int) -> MatchFormat { |
|
|
|
let format = tournamentLevel.federalFormatForBracketRound(roundIndex) |
|
|
|
let format = tournamentLevel.federalFormatForBracketRound(roundIndex) |
|
|
|
if matchFormat.rank > format.rank { |
|
|
|
if format.rank > matchFormat.rank { |
|
|
|
return format |
|
|
|
return format |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return matchFormat |
|
|
|
return matchFormat |
|
|
|
@ -1754,7 +1754,7 @@ extension Tournament { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let rankSourceDate = _mostRecentDateAvailable |
|
|
|
let rankSourceDate = _mostRecentDateAvailable |
|
|
|
let tournaments : [Tournament] = DataStore.shared.tournaments.filter { $0.endDate != nil }.sorted(by: \.startDate).reversed() |
|
|
|
let tournaments : [Tournament] = DataStore.shared.tournaments.filter { $0.endDate != nil && $0.isDeleted == false } |
|
|
|
let tournamentLevel = TournamentLevel.mostUsed(inTournaments: tournaments) |
|
|
|
let tournamentLevel = TournamentLevel.mostUsed(inTournaments: tournaments) |
|
|
|
let tournamentCategory = TournamentCategory.mostUsed(inTournaments: tournaments) |
|
|
|
let tournamentCategory = TournamentCategory.mostUsed(inTournaments: tournaments) |
|
|
|
let federalTournamentAge = FederalTournamentAge.mostUsed(inTournaments: tournaments) |
|
|
|
let federalTournamentAge = FederalTournamentAge.mostUsed(inTournaments: tournaments) |
|
|
|
|