From 36103b92ce4b6cd00925d861f4fb5e381cdc4833 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Thu, 28 May 2020 20:26:29 +0200 Subject: Simplify settings and allow choosing wonders --- sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt | 4 ++-- sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sw-ui/src/main') 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) : 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 -- cgit