Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephtelolahy committed Jan 18, 2025
1 parent 9f3fdc1 commit 979114c
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 8 deletions.
Binary file modified Docs/modular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1620"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MainUITests"
BuildableName = "MainUITests"
BlueprintName = "MainUITests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// GameViewBuilder.swift
// GameContainerView.swift
// WildWestOnline
//
// Created by Hugues Stephano TELOLAHY on 19/09/2024.
Expand All @@ -10,7 +10,7 @@ import Redux
import AppCore
import GameCore

public struct GameViewBuilder: View {
public struct GameContainerView: View {
@EnvironmentObject private var store: Store<AppState, AppDependencies>

public init() {}
Expand Down
30 changes: 24 additions & 6 deletions WildWestOnline/UI/Main/Sources/MainCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import HomeUI
import GameUI

public struct MainCoordinator: View {
@EnvironmentObject private var store: Store<AppState>
@EnvironmentObject private var store: Store<AppState, AppDependencies>

public init() {}

Expand All @@ -24,13 +24,13 @@ public struct MainCoordinator: View {
store: {
store.projection(MainCoordinator.presenter)
},
root: {
rootView: {
SplashContainerView()
},
destination: { destination in
destinationView: { destination in
switch destination {
case .home: HomeViewBuilder().eraseToAnyView()
case .game: GameViewBuilder().eraseToAnyView()
case .home: HomeContainerView().eraseToAnyView()
case .game: GameContainerView().eraseToAnyView()
case .settings: SettingsCoordinator().eraseToAnyView()
}
}
Expand All @@ -40,7 +40,12 @@ public struct MainCoordinator: View {

#Preview {
MainCoordinator()
.environmentObject(Store<AppState>.init(initial: .mockedData))
.environmentObject(
Store<AppState, AppDependencies>.init(
initialState: .mockedData,
dependencies: .mockedData
)
)
}

private extension AppState {
Expand All @@ -53,6 +58,19 @@ private extension AppState {
}
}

private extension AppDependencies {
static var mockedData: Self {
.init(
settings: .init(
savePlayersCount: { _ in },
saveActionDelayMilliSeconds: { _ in },
saveSimulationEnabled: { _ in },
savePreferredFigure: { _ in }
)
)
}
}

extension MainCoordinator {
static let presenter: Presenter<AppState, NavigationStackState<MainDestination>> = { state in
state.navigation.main
Expand Down

0 comments on commit 979114c

Please sign in to comment.