Skip to content

Commit

Permalink
Fix problems with archive by making certain reducers public. (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored Nov 16, 2023
1 parent 40d59a8 commit e385f3f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Sources/GameCore/Drawer.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import ActiveGamesFeature
import ComposableArchitecture

struct ActiveGamesTray: Reducer {
public struct ActiveGamesTray: Reducer {
@Dependency(\.fileClient) var fileClient
@Dependency(\.gameCenter) var gameCenter
@Dependency(\.mainRunLoop.now.date) var now

var body: some ReducerOf<Game> {
public var body: some ReducerOf<Game> {
Reduce { state, action in
switch action {
case .cancelButtonTapped,
Expand Down
4 changes: 2 additions & 2 deletions Sources/GameCore/GameOver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import ComposableArchitecture
import GameOverFeature
import SharedModels

struct GameOverLogic: Reducer {
public struct GameOverLogic: Reducer {
@Dependency(\.database.saveGame) var saveGame

var body: some ReducerOf<Game> {
public var body: some ReducerOf<Game> {
Reduce { state, action in
var allCubesRemoved: Bool {
state.cubes.allSatisfy {
Expand Down
6 changes: 3 additions & 3 deletions Sources/GameCore/SoundsCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import SelectionSoundsCore

extension Reducer<Game.State, Game.Action> {
func sounds() -> some Reducer<Game.State, Game.Action> {
GameSounds(base: self)
_GameSounds(base: self)
}
}

private struct GameSounds<Base: Reducer<Game.State, Game.Action>>: Reducer {
public struct _GameSounds<Base: Reducer<Game.State, Game.Action>>: Reducer {
@Dependency(\.audioPlayer) var audioPlayer
@Dependency(\.date) var date
@Dependency(\.dictionary.contains) var dictionaryContains
Expand All @@ -18,7 +18,7 @@ private struct GameSounds<Base: Reducer<Game.State, Game.Action>>: Reducer {

enum CancelID { case cubeShaking }

var body: some Reducer<Game.State, Game.Action> {
public var body: some Reducer<Game.State, Game.Action> {
self.core
.onChange(of: { /Game.Destination.State.gameOver ~= $0.destination }) { _, _ in
Reduce { _, _ in
Expand Down
4 changes: 2 additions & 2 deletions Sources/GameCore/TurnBased.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import Foundation
import GameOverFeature
import SharedModels

struct TurnBasedLogic: Reducer {
public struct TurnBasedLogic: Reducer {
@Dependency(\.apiClient) var apiClient
@Dependency(\.feedbackGenerator) var feedbackGenerator
@Dependency(\.gameCenter) var gameCenter
@Dependency(\.mainRunLoop.now.date) var now
@Dependency(\.database.saveGame) var saveGame

var body: some ReducerOf<Game> {
public var body: some ReducerOf<Game> {
Reduce { state, action in
guard let turnBasedContext = state.turnBasedContext
else { return .none }
Expand Down
5 changes: 2 additions & 3 deletions Sources/TcaHelpers/FilterReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ extension Reducer {
public func filter(
_ predicate: @escaping (State, Action) -> Bool
) -> some ReducerOf<Self> {
FilterReducer(base: self, predicate: predicate)
_FilterReducer(base: self, predicate: predicate)
}
}

@usableFromInline
struct FilterReducer<Base: Reducer>: Reducer {
public struct _FilterReducer<Base: Reducer>: Reducer {
@usableFromInline
let base: Base

Expand Down

0 comments on commit e385f3f

Please sign in to comment.