diff --git a/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon1.swift b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon1.swift new file mode 100644 index 0000000000..025f9a5fe9 --- /dev/null +++ b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon1.swift @@ -0,0 +1,36 @@ +// Leka - iOS Monorepo +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +import GameEngineKit +import SwiftUI + +private let choicesStep1 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), +] + +private let choicesStep2 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), +] + +private var steps: [StandardStepModel] = [ + StandardStepModel(choices: choicesStep1, gameplay: .superSimon([1]), interface: .twoChoices), + StandardStepModel(choices: choicesStep2, gameplay: .superSimon([1, 0]), interface: .twoChoices), +] + +struct SuperSimon1: View { + @StateObject private var stepManager = StepManager(steps: steps) + + var body: some View { + stepManager.interface + } +} + +struct SuperSimon1_Previews: PreviewProvider { + static var previews: some View { + SuperSimon1() + .previewInterfaceOrientation(.landscapeLeft) + } +} diff --git a/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon2.swift b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon2.swift new file mode 100644 index 0000000000..c9fc4ea9bd --- /dev/null +++ b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon2.swift @@ -0,0 +1,57 @@ +// Leka - iOS Monorepo +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +import Combine +import GameEngineKit +import SwiftUI + +private let choicesStep1 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "yellow", type: .color), +] + +private let choicesStep2 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "yellow", type: .color), +] + +private let choicesStep3 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "yellow", type: .color), +] + +private let choicesStep4 = [ + ChoiceViewModel(item: "red", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "yellow", type: .color), +] + +private var steps: [StandardStepModel] = [ + StandardStepModel(choices: choicesStep1, gameplay: .superSimon([0]), interface: .fourChoices), + StandardStepModel(choices: choicesStep2, gameplay: .superSimon([0, 3]), interface: .fourChoices), + StandardStepModel(choices: choicesStep3, gameplay: .superSimon([0, 3, 1]), interface: .fourChoices), + StandardStepModel(choices: choicesStep4, gameplay: .superSimon([0, 3, 1, 2]), interface: .fourChoices), +] + +struct SuperSimon2: View { + @StateObject private var stepManager = StepManager(steps: steps) + + var body: some View { + stepManager.interface + } +} + +struct SuperSimon2_Previews: PreviewProvider { + static var previews: some View { + SuperSimon2() + .previewInterfaceOrientation(.landscapeLeft) + } +} diff --git a/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon3.swift b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon3.swift new file mode 100644 index 0000000000..d49c8a75fc --- /dev/null +++ b/Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/SuperSimon/SuperSimon3.swift @@ -0,0 +1,85 @@ +// Leka - iOS Monorepo +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +import Combine +import GameEngineKit +import SwiftUI + +private let choicesStep1 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private let choicesStep2 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private let choicesStep3 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private let choicesStep4 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private let choicesStep5 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private let choicesStep6 = [ + ChoiceViewModel(item: "pink", type: .color), + ChoiceViewModel(item: "blue", type: .color), + ChoiceViewModel(item: "purple", type: .color), + ChoiceViewModel(item: "yellow", type: .color), + ChoiceViewModel(item: "green", type: .color), + ChoiceViewModel(item: "red", type: .color), +] + +private var steps: [StandardStepModel] = [ + StandardStepModel(choices: choicesStep1, gameplay: .superSimon([5]), interface: .sixChoices), + StandardStepModel(choices: choicesStep2, gameplay: .superSimon([5, 2]), interface: .sixChoices), + StandardStepModel(choices: choicesStep3, gameplay: .superSimon([5, 2, 4]), interface: .sixChoices), + StandardStepModel(choices: choicesStep4, gameplay: .superSimon([5, 2, 4, 1]), interface: .sixChoices), + StandardStepModel(choices: choicesStep4, gameplay: .superSimon([5, 2, 4, 1, 3]), interface: .sixChoices), + StandardStepModel(choices: choicesStep4, gameplay: .superSimon([5, 2, 4, 1, 3, 0]), interface: .sixChoices), +] + +struct SuperSimon3: View { + @StateObject private var stepManager = StepManager(steps: steps) + + var body: some View { + stepManager.interface + } +} + +struct SuperSimon3_Previews: PreviewProvider { + static var previews: some View { + SuperSimon3() + .previewInterfaceOrientation(.landscapeLeft) + } +} diff --git a/Apps/LekaActivityUIExplorer/Sources/NewUI/Data/ActivityList.swift b/Apps/LekaActivityUIExplorer/Sources/NewUI/Data/ActivityList.swift index e1b2f2bf10..3d6a8dbc5b 100644 --- a/Apps/LekaActivityUIExplorer/Sources/NewUI/Data/ActivityList.swift +++ b/Apps/LekaActivityUIExplorer/Sources/NewUI/Data/ActivityList.swift @@ -135,4 +135,19 @@ let kListOfAvailablesActivities: [ActivityModel] = [ instructions: "Touch the right color", view: AnyView(ColorQuest3()) ), + ActivityModel( + title: "SuperSimon1", + instructions: "Touch the right color sequence", + view: AnyView(SuperSimon1()) + ), + ActivityModel( + title: "SuperSimon2", + instructions: "Touch the right color sequence", + view: AnyView(SuperSimon2()) + ), + ActivityModel( + title: "SuperSimon3", + instructions: "Touch the right color sequence", + view: AnyView(SuperSimon3()) + ), ]