diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-28 20:26:29 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-31 11:16:00 +0200 |
commit | 36103b92ce4b6cd00925d861f4fb5e381cdc4833 (patch) | |
tree | 4c2bfced8317526b24da23fcef9febe6368c736e /sw-ui | |
parent | Attempt at fixing race conditions with bot subscriptions (diff) | |
download | seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.gz seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.bz2 seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.zip |
Simplify settings and allow choosing wonders
Diffstat (limited to 'sw-ui')
-rw-r--r-- | sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt | 4 | ||||
-rw-r--r-- | sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt index 6fbaadb9..7badb11c 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt @@ -1,6 +1,6 @@ package org.luxons.sevenwonders.ui.redux -import org.luxons.sevenwonders.model.CustomizableSettings +import org.luxons.sevenwonders.model.Settings import org.luxons.sevenwonders.model.PlayerMove import redux.RAction @@ -14,7 +14,7 @@ data class RequestAddBot(val botDisplayName: String) : RAction data class RequestReorderPlayers(val orderedPlayers: List<String>) : RAction -data class RequestUpdateSettings(val settings: CustomizableSettings) : RAction +data class RequestUpdateSettings(val settings: Settings) : RAction class RequestStartGame : RAction diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt index 1ff0d0ec..047e948a 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt @@ -71,7 +71,7 @@ private fun gameStateReducer(gameState: GameState?, action: RAction): GameState? is PreparedMoveEvent -> gameState?.copy(currentPreparedMove = action.move) is RequestUnprepareMove -> gameState?.copy(currentPreparedMove = null) is PreparedCardEvent -> gameState?.copy( - preparedCardsByUsername = gameState.preparedCardsByUsername + (action.card.player.username to action.card.cardBack) + preparedCardsByUsername = gameState.preparedCardsByUsername + (action.card.username to action.card.cardBack) ) is PlayerReadyEvent -> gameState?.copy(players = gameState.players.map { p -> if (p.username == action.username) p.copy(isReady = true) else p |