-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (UIExplorer): Add ColorQuest 1, 2, 3 activities
- Loading branch information
Showing
4 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ColorQuest/ColorQuest1.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright 2023 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import GameEngineKit | ||
import SwiftUI | ||
|
||
private let choicesStep1 = [ | ||
ChoiceViewModel(item: "blue", type: .color, rightAnswer: true) | ||
] | ||
|
||
private let choicesStep2 = [ | ||
ChoiceViewModel(item: "green", type: .color, rightAnswer: true) | ||
] | ||
|
||
private let choicesStep3 = [ | ||
ChoiceViewModel(item: "pink", type: .color, rightAnswer: true) | ||
] | ||
|
||
private let choicesStep4 = [ | ||
ChoiceViewModel(item: "yellow", type: .color, rightAnswer: true) | ||
] | ||
|
||
private let choicesStep5 = [ | ||
ChoiceViewModel(item: "red", type: .color, rightAnswer: true) | ||
|
||
] | ||
|
||
private var steps: [StandardStepModel] = [ | ||
StandardStepModel(choices: choicesStep1, gameplay: .colorQuest, interface: .oneChoice), | ||
StandardStepModel(choices: choicesStep2, gameplay: .colorQuest, interface: .oneChoice), | ||
StandardStepModel(choices: choicesStep3, gameplay: .colorQuest, interface: .oneChoice), | ||
StandardStepModel(choices: choicesStep4, gameplay: .colorQuest, interface: .oneChoice), | ||
StandardStepModel(choices: choicesStep5, gameplay: .colorQuest, interface: .oneChoice), | ||
] | ||
|
||
struct ColorQuest1: View { | ||
@StateObject private var stepManager = StepManager(steps: steps) | ||
|
||
var body: some View { | ||
stepManager.interface | ||
} | ||
} | ||
|
||
struct ColorQuest1_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ColorQuest1() | ||
.previewInterfaceOrientation(.landscapeLeft) | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ColorQuest/ColorQuest2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// 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, rightAnswer: true), | ||
] | ||
|
||
private let choicesStep2 = [ | ||
ChoiceViewModel(item: "purple", type: .color), | ||
ChoiceViewModel(item: "blue", type: .color, rightAnswer: true), | ||
] | ||
|
||
private let choicesStep3 = [ | ||
ChoiceViewModel(item: "yellow", type: .color, rightAnswer: true), | ||
ChoiceViewModel(item: "red", type: .color), | ||
] | ||
|
||
private let choicesStep4 = [ | ||
ChoiceViewModel(item: "pink", type: .color), | ||
ChoiceViewModel(item: "yellow", type: .color, rightAnswer: true), | ||
] | ||
|
||
private let choicesStep5 = [ | ||
ChoiceViewModel(item: "red", type: .color, rightAnswer: true), | ||
ChoiceViewModel(item: "green", type: .color), | ||
] | ||
|
||
private var steps: [StandardStepModel] = [ | ||
StandardStepModel(choices: choicesStep1, gameplay: .colorQuest, interface: .twoChoices), | ||
StandardStepModel(choices: choicesStep2, gameplay: .colorQuest, interface: .twoChoices), | ||
StandardStepModel(choices: choicesStep3, gameplay: .colorQuest, interface: .twoChoices), | ||
StandardStepModel(choices: choicesStep4, gameplay: .colorQuest, interface: .twoChoices), | ||
StandardStepModel(choices: choicesStep5, gameplay: .colorQuest, interface: .twoChoices), | ||
] | ||
|
||
struct ColorQuest2: View { | ||
@StateObject private var stepManager = StepManager(steps: steps) | ||
|
||
var body: some View { | ||
stepManager.interface | ||
} | ||
} | ||
|
||
struct ColorQuest2_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ColorQuest2() | ||
.previewInterfaceOrientation(.landscapeLeft) | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ColorQuest/ColorQuest3.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// 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: "blue", type: .color, rightAnswer: true), | ||
ChoiceViewModel(item: "yellow", type: .color), | ||
] | ||
|
||
private let choicesStep2 = [ | ||
ChoiceViewModel(item: "purple", type: .color), | ||
ChoiceViewModel(item: "green", type: .color), | ||
ChoiceViewModel(item: "blue", type: .color, rightAnswer: true), | ||
] | ||
|
||
private let choicesStep3 = [ | ||
ChoiceViewModel(item: "yellow", type: .color, rightAnswer: true), | ||
ChoiceViewModel(item: "blue", type: .color), | ||
ChoiceViewModel(item: "red", type: .color), | ||
] | ||
|
||
private let choicesStep4 = [ | ||
ChoiceViewModel(item: "green", type: .color), | ||
ChoiceViewModel(item: "pink", type: .color), | ||
ChoiceViewModel(item: "yellow", type: .color, rightAnswer: true), | ||
] | ||
|
||
private let choicesStep5 = [ | ||
ChoiceViewModel(item: "red", type: .color, rightAnswer: true), | ||
ChoiceViewModel(item: "blue", type: .color), | ||
ChoiceViewModel(item: "yellow", type: .color), | ||
] | ||
|
||
private var steps: [StandardStepModel] = [ | ||
StandardStepModel(choices: choicesStep1, gameplay: .colorQuest, interface: .threeChoicesInline), | ||
StandardStepModel(choices: choicesStep2, gameplay: .colorQuest, interface: .threeChoicesInline), | ||
StandardStepModel(choices: choicesStep3, gameplay: .colorQuest, interface: .threeChoicesInline), | ||
StandardStepModel(choices: choicesStep4, gameplay: .colorQuest, interface: .threeChoicesInline), | ||
StandardStepModel(choices: choicesStep5, gameplay: .colorQuest, interface: .threeChoicesInline), | ||
] | ||
|
||
struct ColorQuest3: View { | ||
@StateObject private var stepManager = StepManager(steps: steps) | ||
|
||
var body: some View { | ||
stepManager.interface | ||
} | ||
} | ||
|
||
struct ColorQuest3_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ColorQuest3() | ||
.previewInterfaceOrientation(.landscapeLeft) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters