improve encoding

multistore
Laurent 1 year ago
parent f3f2ebd032
commit 6925ca14b8
  1. 4
      PadelClub/Data/Tournament.swift

@ -307,9 +307,9 @@ class Tournament : ModelObject, Storable {
func _encodeIsCanceled(container: inout KeyedEncodingContainer<CodingKeys>) throws { func _encodeIsCanceled(container: inout KeyedEncodingContainer<CodingKeys>) throws {
let max: Int = 9 let max: Int = 9
var sequence = (1...18).map { _ in Int.random(in: (0..<max)) } var sequence = (1...18).map { _ in Int.random(in: (0...max)) }
sequence.append(self.isCanceled.encodedValue) sequence.append(self.isCanceled.encodedValue)
sequence.append(contentsOf: (1...13).map { _ in Int.random(in: (0..<max ))} ) sequence.append(contentsOf: (1...13).map { _ in Int.random(in: (0...max ))} )
let stringCombo: [String] = sequence.map { $0.formatted() } let stringCombo: [String] = sequence.map { $0.formatted() }
let joined: String = stringCombo.joined(separator: "") let joined: String = stringCombo.joined(separator: "")

Loading…
Cancel
Save