|
|
|
|
@ -378,14 +378,20 @@ final public class TeamRegistration: BaseTeamRegistration, SideStorable { |
|
|
|
|
resetBracketPosition() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public func pasteData(_ exportFormat: ExportFormat = .rawText, _ index: Int = 0) -> String { |
|
|
|
|
public func pasteData(_ exportFormat: ExportFormat = .rawText, type: ExportType, _ index: Int = 0) -> String { |
|
|
|
|
switch exportFormat { |
|
|
|
|
case .rawText: |
|
|
|
|
return [playersPasteData(exportFormat), formattedInscriptionDate(exportFormat), name] |
|
|
|
|
switch type { |
|
|
|
|
case .sharing: |
|
|
|
|
return [playersPasteData(exportFormat, type: type), formattedInscriptionDate(exportFormat), name] |
|
|
|
|
.compactMap({ $0 }).joined(separator: exportFormat.newLineSeparator()) |
|
|
|
|
case .payment: |
|
|
|
|
return [playersPasteData(exportFormat, type: type), name] |
|
|
|
|
.compactMap({ $0 }).joined(separator: exportFormat.newLineSeparator()) |
|
|
|
|
} |
|
|
|
|
case .csv: |
|
|
|
|
return [ |
|
|
|
|
index.formatted(), playersPasteData(exportFormat), |
|
|
|
|
index.formatted(), playersPasteData(exportFormat, type: type), |
|
|
|
|
isWildCard() ? "WC" : weight.formatted(), |
|
|
|
|
].joined(separator: exportFormat.separator()) |
|
|
|
|
} |
|
|
|
|
@ -435,15 +441,20 @@ final public class TeamRegistration: BaseTeamRegistration, SideStorable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public func playersPasteData(_ exportFormat: ExportFormat = .rawText) -> String { |
|
|
|
|
public func playersPasteData(_ exportFormat: ExportFormat = .rawText, type: ExportType) -> String { |
|
|
|
|
switch exportFormat { |
|
|
|
|
case .rawText: |
|
|
|
|
return players().map { $0.pasteData(exportFormat) }.joined( |
|
|
|
|
return players().map { $0.pasteData(exportFormat, type: type) }.joined( |
|
|
|
|
separator: exportFormat.newLineSeparator()) |
|
|
|
|
case .csv: |
|
|
|
|
return players().map { |
|
|
|
|
[$0.pasteData(exportFormat), isWildCard() ? "WC" : $0.computedRank.formatted()] |
|
|
|
|
switch type { |
|
|
|
|
case .sharing: |
|
|
|
|
[$0.pasteData(exportFormat, type: type), isWildCard() ? "WC" : $0.computedRank.formatted()] |
|
|
|
|
.joined(separator: exportFormat.separator()) |
|
|
|
|
case .payment: |
|
|
|
|
$0.pasteData(exportFormat, type: type) |
|
|
|
|
} |
|
|
|
|
}.joined(separator: exportFormat.separator()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|