|
|
|
@ -628,6 +628,22 @@ final public class GroupStage: BaseGroupStage, SideStorable { |
|
|
|
} |
|
|
|
} |
|
|
|
tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams) |
|
|
|
tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: teams) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public func setData(from correspondingGroupStage: GroupStage, tournamentStartDate: Date, previousTournamentStartDate: Date) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.matchFormat = correspondingGroupStage.matchFormat |
|
|
|
|
|
|
|
if let correspondingPlannedStartDate = correspondingGroupStage.plannedStartDate { |
|
|
|
|
|
|
|
let offset = correspondingPlannedStartDate.timeIntervalSince(previousTournamentStartDate) |
|
|
|
|
|
|
|
self.startDate = tournamentStartDate.addingTimeInterval(offset) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
self.size = correspondingGroupStage.size |
|
|
|
|
|
|
|
self.name = correspondingGroupStage.name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let matches = correspondingGroupStage._matches() |
|
|
|
|
|
|
|
for (index, match) in self._matches().enumerated() { |
|
|
|
|
|
|
|
match.setData(from: matches[index], tournamentStartDate: tournamentStartDate, previousTournamentStartDate: previousTournamentStartDate) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override func deleteDependencies(store: Store, actionOption: ActionOption) { |
|
|
|
public override func deleteDependencies(store: Store, actionOption: ActionOption) { |
|
|
|
store.deleteDependencies(type: Match.self, actionOption: actionOption) { $0.groupStage == self.id } |
|
|
|
store.deleteDependencies(type: Match.self, actionOption: actionOption) { $0.groupStage == self.id } |
|
|
|
|