|
|
|
@ -1067,6 +1067,11 @@ defer { |
|
|
|
registrationDate = previousTeamRegistrationDate |
|
|
|
registrationDate = previousTeamRegistrationDate |
|
|
|
} |
|
|
|
} |
|
|
|
let newTeam = addTeam(team.players, registrationDate: registrationDate, name: team.name) |
|
|
|
let newTeam = addTeam(team.players, registrationDate: registrationDate, name: team.name) |
|
|
|
|
|
|
|
if isAnimation() { |
|
|
|
|
|
|
|
if newTeam.weight == 0 { |
|
|
|
|
|
|
|
newTeam.weight = team.index(in: teams) ?? 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
teamsToImport.append(newTeam) |
|
|
|
teamsToImport.append(newTeam) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1795,6 +1800,11 @@ defer { |
|
|
|
players.forEach { player in |
|
|
|
players.forEach { player in |
|
|
|
player.teamRegistration = team.id |
|
|
|
player.teamRegistration = team.id |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if isAnimation() { |
|
|
|
|
|
|
|
if team.weight == 0 { |
|
|
|
|
|
|
|
team.weight = unsortedTeams().count |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return team |
|
|
|
return team |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1910,9 +1920,9 @@ defer { |
|
|
|
private func _defaultSorting() -> [MySortDescriptor<TeamRegistration>] { |
|
|
|
private func _defaultSorting() -> [MySortDescriptor<TeamRegistration>] { |
|
|
|
switch teamSorting { |
|
|
|
switch teamSorting { |
|
|
|
case .rank: |
|
|
|
case .rank: |
|
|
|
[.keyPath(\TeamRegistration.initialWeight), .keyPath(\TeamRegistration.registrationDate!)] |
|
|
|
[.keyPath(\TeamRegistration.initialWeight), .keyPath(\TeamRegistration.registrationDate!), .keyPath(\TeamRegistration.id)] |
|
|
|
case .inscriptionDate: |
|
|
|
case .inscriptionDate: |
|
|
|
[.keyPath(\TeamRegistration.registrationDate!), .keyPath(\TeamRegistration.initialWeight)] |
|
|
|
[.keyPath(\TeamRegistration.registrationDate!), .keyPath(\TeamRegistration.initialWeight), .keyPath(\TeamRegistration.id)] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1922,7 +1932,7 @@ defer { |
|
|
|
&& federalTournamentAge == build.age |
|
|
|
&& federalTournamentAge == build.age |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private let _currentSelectionSorting : [MySortDescriptor<TeamRegistration>] = [.keyPath(\.weight), .keyPath(\.registrationDate!)] |
|
|
|
private let _currentSelectionSorting : [MySortDescriptor<TeamRegistration>] = [.keyPath(\.weight), .keyPath(\.registrationDate!), .keyPath(\.id)] |
|
|
|
|
|
|
|
|
|
|
|
private func _matchSchedulers() -> [MatchScheduler] { |
|
|
|
private func _matchSchedulers() -> [MatchScheduler] { |
|
|
|
return self.tournamentStore.matchSchedulers.filter { $0.tournament == self.id } |
|
|
|
return self.tournamentStore.matchSchedulers.filter { $0.tournament == self.id } |
|
|
|
|