|
|
|
|
@ -13,15 +13,15 @@ class BaseMatchScheduler: BaseModelObject, Storable { |
|
|
|
|
|
|
|
|
|
var id: String = Store.randomId() |
|
|
|
|
var tournament: String = "" |
|
|
|
|
var timeDifferenceLimit: Int = 0 |
|
|
|
|
var timeDifferenceLimit: Int = 5 |
|
|
|
|
var loserBracketRotationDifference: Int = 0 |
|
|
|
|
var upperBracketRotationDifference: Int = 0 |
|
|
|
|
var accountUpperBracketBreakTime: Bool = false |
|
|
|
|
var upperBracketRotationDifference: Int = 1 |
|
|
|
|
var accountUpperBracketBreakTime: Bool = true |
|
|
|
|
var accountLoserBracketBreakTime: Bool = false |
|
|
|
|
var randomizeCourts: Bool = false |
|
|
|
|
var randomizeCourts: Bool = true |
|
|
|
|
var rotationDifferenceIsImportant: Bool = false |
|
|
|
|
var shouldHandleUpperRoundSlice: Bool = false |
|
|
|
|
var shouldEndRoundBeforeStartingNext: Bool = false |
|
|
|
|
var shouldEndRoundBeforeStartingNext: Bool = true |
|
|
|
|
var groupStageChunkCount: Int? = nil |
|
|
|
|
var overrideCourtsUnavailability: Bool = false |
|
|
|
|
var shouldTryToFillUpCourtsAvailable: Bool = false |
|
|
|
|
@ -31,15 +31,15 @@ class BaseMatchScheduler: BaseModelObject, Storable { |
|
|
|
|
init( |
|
|
|
|
id: String = Store.randomId(), |
|
|
|
|
tournament: String = "", |
|
|
|
|
timeDifferenceLimit: Int = 0, |
|
|
|
|
timeDifferenceLimit: Int = 5, |
|
|
|
|
loserBracketRotationDifference: Int = 0, |
|
|
|
|
upperBracketRotationDifference: Int = 0, |
|
|
|
|
accountUpperBracketBreakTime: Bool = false, |
|
|
|
|
upperBracketRotationDifference: Int = 1, |
|
|
|
|
accountUpperBracketBreakTime: Bool = true, |
|
|
|
|
accountLoserBracketBreakTime: Bool = false, |
|
|
|
|
randomizeCourts: Bool = false, |
|
|
|
|
randomizeCourts: Bool = true, |
|
|
|
|
rotationDifferenceIsImportant: Bool = false, |
|
|
|
|
shouldHandleUpperRoundSlice: Bool = false, |
|
|
|
|
shouldEndRoundBeforeStartingNext: Bool = false, |
|
|
|
|
shouldEndRoundBeforeStartingNext: Bool = true, |
|
|
|
|
groupStageChunkCount: Int? = nil, |
|
|
|
|
overrideCourtsUnavailability: Bool = false, |
|
|
|
|
shouldTryToFillUpCourtsAvailable: Bool = false, |
|
|
|
|
@ -88,15 +88,15 @@ class BaseMatchScheduler: BaseModelObject, Storable { |
|
|
|
|
let container = try decoder.container(keyedBy: CodingKeys.self) |
|
|
|
|
self.id = try container.decodeIfPresent(String.self, forKey: ._id) ?? Store.randomId() |
|
|
|
|
self.tournament = try container.decodeIfPresent(String.self, forKey: ._tournament) ?? "" |
|
|
|
|
self.timeDifferenceLimit = try container.decodeIfPresent(Int.self, forKey: ._timeDifferenceLimit) ?? 0 |
|
|
|
|
self.timeDifferenceLimit = try container.decodeIfPresent(Int.self, forKey: ._timeDifferenceLimit) ?? 5 |
|
|
|
|
self.loserBracketRotationDifference = try container.decodeIfPresent(Int.self, forKey: ._loserBracketRotationDifference) ?? 0 |
|
|
|
|
self.upperBracketRotationDifference = try container.decodeIfPresent(Int.self, forKey: ._upperBracketRotationDifference) ?? 0 |
|
|
|
|
self.accountUpperBracketBreakTime = try container.decodeIfPresent(Bool.self, forKey: ._accountUpperBracketBreakTime) ?? false |
|
|
|
|
self.upperBracketRotationDifference = try container.decodeIfPresent(Int.self, forKey: ._upperBracketRotationDifference) ?? 1 |
|
|
|
|
self.accountUpperBracketBreakTime = try container.decodeIfPresent(Bool.self, forKey: ._accountUpperBracketBreakTime) ?? true |
|
|
|
|
self.accountLoserBracketBreakTime = try container.decodeIfPresent(Bool.self, forKey: ._accountLoserBracketBreakTime) ?? false |
|
|
|
|
self.randomizeCourts = try container.decodeIfPresent(Bool.self, forKey: ._randomizeCourts) ?? false |
|
|
|
|
self.randomizeCourts = try container.decodeIfPresent(Bool.self, forKey: ._randomizeCourts) ?? true |
|
|
|
|
self.rotationDifferenceIsImportant = try container.decodeIfPresent(Bool.self, forKey: ._rotationDifferenceIsImportant) ?? false |
|
|
|
|
self.shouldHandleUpperRoundSlice = try container.decodeIfPresent(Bool.self, forKey: ._shouldHandleUpperRoundSlice) ?? false |
|
|
|
|
self.shouldEndRoundBeforeStartingNext = try container.decodeIfPresent(Bool.self, forKey: ._shouldEndRoundBeforeStartingNext) ?? false |
|
|
|
|
self.shouldEndRoundBeforeStartingNext = try container.decodeIfPresent(Bool.self, forKey: ._shouldEndRoundBeforeStartingNext) ?? true |
|
|
|
|
self.groupStageChunkCount = try container.decodeIfPresent(Int.self, forKey: ._groupStageChunkCount) ?? nil |
|
|
|
|
self.overrideCourtsUnavailability = try container.decodeIfPresent(Bool.self, forKey: ._overrideCourtsUnavailability) ?? false |
|
|
|
|
self.shouldTryToFillUpCourtsAvailable = try container.decodeIfPresent(Bool.self, forKey: ._shouldTryToFillUpCourtsAvailable) ?? false |
|
|
|
|
|