|
|
|
|
@ -53,7 +53,7 @@ enum CallDestination: Identifiable, Selectable, Equatable { |
|
|
|
|
let allSeedCalled = tournament.seeds().filter({ tournament.isStartDateIsDifferentThanCallDate($0) || $0.callDate == nil }) |
|
|
|
|
return allSeedCalled.count |
|
|
|
|
case .brackets(let tournament): |
|
|
|
|
let availableSeeds = tournament.availableSeeds().filter({ tournament.isStartDateIsDifferentThanCallDate($0) || $0.callDate == nil }) |
|
|
|
|
let availableSeeds = tournament.availableSeeds().filter({ $0.callDate == nil }) |
|
|
|
|
return availableSeeds.count |
|
|
|
|
case .groupStages(let tournament): |
|
|
|
|
let allSeedCalled = tournament.groupStageTeams().filter({ tournament.isStartDateIsDifferentThanCallDate($0) || $0.callDate == nil }) |
|
|
|
|
@ -74,7 +74,7 @@ enum CallDestination: Identifiable, Selectable, Equatable { |
|
|
|
|
let allSeedCalled = tournament.seeds().allSatisfy({ tournament.isStartDateIsDifferentThanCallDate($0) == false }) |
|
|
|
|
return allSeedCalled ? .checkmark : nil |
|
|
|
|
case .brackets(let tournament): |
|
|
|
|
let availableSeeds = tournament.availableSeeds().allSatisfy({ tournament.isStartDateIsDifferentThanCallDate($0) == false }) |
|
|
|
|
let availableSeeds = tournament.availableSeeds().allSatisfy({ $0.called() }) |
|
|
|
|
return availableSeeds ? .checkmark : nil |
|
|
|
|
case .groupStages(let tournament): |
|
|
|
|
let allSeedCalled = tournament.groupStageTeams().allSatisfy({ tournament.isStartDateIsDifferentThanCallDate($0) == false }) |
|
|
|
|
@ -95,7 +95,7 @@ struct TournamentCallView: View { |
|
|
|
|
var destinations = [CallDestination]() |
|
|
|
|
let groupStageTeams = tournament.groupStageTeams() |
|
|
|
|
let seededTeams = tournament.seededTeams() |
|
|
|
|
if groupStageTeams.isEmpty == false { |
|
|
|
|
if groupStageTeams.isEmpty == false && tournament.groupStageCount > 0 { |
|
|
|
|
destinations.append(.groupStages(tournament)) |
|
|
|
|
self._selectedDestination = State(wrappedValue: .groupStages(tournament)) |
|
|
|
|
} |
|
|
|
|
|