Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo/feature/Correctly init activities #324

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GameEngineKit
import SwiftUI

struct DanceFreezeActivity: View {
let gameplay = DanceFreezeGameplay()
@StateObject private var gameplay = DanceFreezeGameplay()

var body: some View {
DanceFreezeView(gameplay: gameplay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
interface: .listenFourChoices(AudioRecordingModel(name: "guitar", file: "guitar"))),
]

struct ListenThenTouchToSelectFourChoicesActivity: View {

Check failure on line 61 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelecFourChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectFourChoicesActivity' should be between 4 and 40 characters long (type_name)
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
}
}

struct ListenThenTouchToSelectFourChoicesActivity_Previews: PreviewProvider {

Check failure on line 69 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelecFourChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectFourChoicesActivity' should be between 4 and 40 characters long (type_name)
static var previews: some View {
ListenThenTouchToSelectFourChoicesActivity()
.previewInterfaceOrientation(.landscapeLeft)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private var steps: [StandardStepModel] = [
]

struct ListenThenTouchToSelectOneChoiceActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
interface: .listenSixChoices(AudioRecordingModel(name: "guitar", file: "guitar"))),
]

struct ListenThenTouchToSelectSixChoicesActivity: View {

Check failure on line 71 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectSixChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectSixChoicesActivity' should be between 4 and 40 characters long (type_name)
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
}
}

struct ListenThenTouchToSelectSixChoicesActivity_Previews: PreviewProvider {

Check failure on line 79 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectSixChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectSixChoicesActivity' should be between 4 and 40 characters long (type_name)
static var previews: some View {
ListenThenTouchToSelectSixChoicesActivity()
.previewInterfaceOrientation(.landscapeLeft)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private var steps: [StandardStepModel] = [
]

struct ListenThenTouchToSelectThreeChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
interface: .listenThreeChoicesInline(AudioRecordingModel(name: "guitar", file: "guitar"))),
]

struct ListenThenTouchToSelectThreeChoicesInlineActivity: View {

Check failure on line 56 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectThreeChoicesInlineActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectThreeChoicesInlineActivity' should be between 4 and 40 characters long (type_name)
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
}
}

struct ListenThenTouchToSelectThreeChoicesInlineActivity_Previews: PreviewProvider {

Check failure on line 64 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectThreeChoicesInlineActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectThreeChoicesInlineActivity' should be between 4 and 40 characters long (type_name)
static var previews: some View {
ListenThenTouchToSelectThreeChoicesInlineActivity()
.previewInterfaceOrientation(.landscapeLeft)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
interface: .listenTwoChoices(AudioRecordingModel(name: "guitar", file: "guitar"))),
]

struct ListenThenTouchToSelectTwoChoicesActivity: View {

Check failure on line 51 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectTwoChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectTwoChoicesActivity' should be between 4 and 40 characters long (type_name)
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
}
}

struct ListenThenTouchToSelectTwoChoicesActivity_Previews: PreviewProvider {

Check failure on line 59 in Apps/LekaActivityUIExplorer/Sources/NewUI/Activities/ListenThenTouchToSelect/ListenThenTouchToSelectTwoChoicesActivity.swift

View workflow job for this annotation

GitHub Actions / lint

Type name 'ListenThenTouchToSelectTwoChoicesActivity' should be between 4 and 40 characters long (type_name)
static var previews: some View {
ListenThenTouchToSelectTwoChoicesActivity()
.previewInterfaceOrientation(.landscapeLeft)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GameEngineKit
import SwiftUI

struct MelodyActivity: View {
let gameplay = MelodyGameplay(song: kListOfMelodySongsAvailable[0])
@StateObject private var gameplay = MelodyGameplay(song: kListOfMelodySongsAvailable[0])

var body: some View {
MelodyView(gameplay: gameplay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectFiveChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectFourChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectFourChoicesInlineActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectOneChoiceActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectSixChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectThreeChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectThreeChoicesInlineActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private var steps: [StandardStepModel] = [
]

struct TouchToSelectTwoChoicesActivity: View {
@ObservedObject private var stepManager = StepManager(steps: steps)
@StateObject private var stepManager = StepManager(steps: steps)

var body: some View {
stepManager.interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Combine
import SwiftUI

public class DanceFreezeGameplay {
public class DanceFreezeGameplay: ObservableObject {
var audioPlayer: AudioPlayer
@Published public var progress: CGFloat = 0.0
@Published public var state: GameplayState = .idle
Expand All @@ -32,11 +32,11 @@
if audioPlayer.isPlaying {
audioPlayer.pause()
isDancing = false
// TODO(@ladislas): Stop motors and lights

Check failure on line 35 in Modules/GameEngineKit/Sources/Specific/DanceFreeze/Gameplay/DanceFreezeGameplay.swift

View workflow job for this annotation

GitHub Actions / lint

TODOs should be resolved ((@ladislas): Stop motors and l...) (todo)
} else {
audioPlayer.play()
isDancing = true
// TODO(@ladislas): Run motors and lights to dance

Check failure on line 39 in Modules/GameEngineKit/Sources/Specific/DanceFreeze/Gameplay/DanceFreezeGameplay.swift

View workflow job for this annotation

GitHub Actions / lint

TODOs should be resolved ((@ladislas): Run motors and li...) (todo)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import AudioKit
import Combine
import SwiftUI

public class MelodyGameplay {
public class MelodyGameplay: ObservableObject {
@Published public var progress: CGFloat = 0.0
@Published public var state: GameplayState = .idle

Expand Down