|
|
|
|
@ -124,7 +124,7 @@ struct TableStructureView: View { |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
LabeledContent { |
|
|
|
|
StepperView(count: $teamCount, minimum: 4, maximum: 128) { |
|
|
|
|
StepperView(count: $teamCount, minimum: 2, maximum: 128) { |
|
|
|
|
|
|
|
|
|
} submitFollowUpAction: { |
|
|
|
|
_verifyValueIntegrity() |
|
|
|
|
@ -536,6 +536,7 @@ struct TableStructureView: View { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func _reset() { |
|
|
|
|
let tc = tournament.teamCount |
|
|
|
|
tournament.unsortedTeams().forEach { |
|
|
|
|
$0.resetPositions() |
|
|
|
|
} |
|
|
|
|
@ -549,7 +550,8 @@ struct TableStructureView: View { |
|
|
|
|
_updatePreset() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tournament.teamCount = teamCount |
|
|
|
|
teamCount = tc |
|
|
|
|
tournament.teamCount = tc |
|
|
|
|
tournament.groupStageCount = groupStageCount |
|
|
|
|
tournament.teamsPerGroupStage = teamsPerGroupStage |
|
|
|
|
tournament.qualifiedPerGroupStage = qualifiedPerGroupStage |
|
|
|
|
@ -598,7 +600,7 @@ struct TableStructureView: View { |
|
|
|
|
|
|
|
|
|
private func _save(rebuildEverything: Bool = false) async { |
|
|
|
|
_verifyValueIntegrity() |
|
|
|
|
|
|
|
|
|
let tc = tournament.teamCount |
|
|
|
|
do { |
|
|
|
|
let requirements = Set(updatedElements.compactMap { $0.requiresRebuilding }) |
|
|
|
|
|
|
|
|
|
@ -774,8 +776,8 @@ struct TableStructureView: View { |
|
|
|
|
groupStageCount = maxGroupStages |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if teamCount < 4 { |
|
|
|
|
teamCount = 4 |
|
|
|
|
if teamCount < 2 { |
|
|
|
|
teamCount = 2 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if groupStageCount < 0 { |
|
|
|
|
|