-
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.
✨ (GEKExample): Add MagicCardExercises
- Loading branch information
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
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
139 changes: 139 additions & 0 deletions
139
...ameEngineKit/Examples/GameEngineKitExample/Sources/App/Exercises/MagicCardExercises.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,139 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import ContentKit | ||
import GameEngineKit | ||
import RobotKit | ||
import SwiftUI | ||
|
||
// TODO: (@ladislas) to remove in the future, replaced by actual data | ||
Check warning on line 10 in Modules/GameEngineKit/Examples/GameEngineKitExample/Sources/App/Exercises/MagicCardExercises.swift GitHub Actions / swiftlint
|
||
extension ExerciseData { | ||
static let MagicCardxFindTheRightAnswersxEmotions: [MagicCardCoordinatorFindTheRightAnswersChoiceModel] = [ | ||
.init(value: MagicCard.emotion_disgust_leka, isRightAnswer: true), | ||
.init(value: MagicCard.emotion_fear_leka), | ||
.init(value: MagicCard.emotion_joy_leka), | ||
.init(value: MagicCard.emotion_sadness_leka), | ||
.init(value: MagicCard.emotion_anger_leka), | ||
] | ||
|
||
static let MagicCardxFindTheRightAnswersxNumbers: [MagicCardCoordinatorFindTheRightAnswersChoiceModel] = [ | ||
.init(value: MagicCard.number_0), | ||
.init(value: MagicCard.number_1), | ||
.init(value: MagicCard.number_2), | ||
.init(value: MagicCard.number_3), | ||
.init(value: MagicCard.number_4), | ||
.init(value: MagicCard.number_5, isRightAnswer: true), | ||
.init(value: MagicCard.number_6), | ||
] | ||
|
||
static let MagicCardxFindTheRightAnswersxColors: [MagicCardCoordinatorFindTheRightAnswersChoiceModel] = [ | ||
.init(value: MagicCard.color_red), | ||
.init(value: MagicCard.color_blue), | ||
.init(value: MagicCard.color_yellow), | ||
.init(value: MagicCard.color_green), | ||
.init(value: MagicCard.color_orange, isRightAnswer: true), | ||
.init(value: MagicCard.color_purple), | ||
] | ||
} | ||
|
||
// MARK: - MagicCardExercises | ||
|
||
struct MagicCardExercises: View { | ||
var body: some View { | ||
Text("MagicCard") | ||
.font(.title) | ||
.padding() | ||
ScrollView(.horizontal) { | ||
HStack(spacing: 20) { | ||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxNumbers, | ||
action: Exercise.Action.robot(type: .image("magicCardNumbers5Five")) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("Number Recognition") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "Number Recognition", color: .purple) | ||
} | ||
|
||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxColors, | ||
action: Exercise.Action.robot(type: .image("magicCardColorsOrangePaint")) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("Screen Color Recognition") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "Screen Color Recognition", color: .purple) | ||
} | ||
|
||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxColors, | ||
action: Exercise.Action.robot(type: .image("magicCardColorsOrangePaint")) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("LED Color Recognition") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "LED Color Recognition", color: .purple) | ||
} | ||
|
||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxEmotions, | ||
action: Exercise.Action.robot(type: .image("robotFaceDisgusted")) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("Emotion Recognition") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "Emotion Recognition", color: .purple) | ||
} | ||
|
||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxNumbers, | ||
action: Exercise.Action.robot(type: .spots(5)) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("Spot Counting") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "Spot Counting", color: .purple) | ||
} | ||
|
||
NavigationLink { | ||
let coordinator = MagicCardCoordinatorFindTheRightAnswers( | ||
choices: ExerciseData.MagicCardxFindTheRightAnswersxNumbers, | ||
action: Exercise.Action.robot(type: .flash(5)) | ||
) | ||
let viewModel = MagicCardViewViewModel(coordinator: coordinator) | ||
|
||
MagicCardView(viewModel: viewModel) | ||
.navigationTitle("Flash Counting") | ||
.navigationBarTitleDisplayMode(.large) | ||
} label: { | ||
ExerciseNavigationButtonLabel(text: "Flash Counting", color: .purple) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
MagicCardExercises() | ||
} |