diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-27 00:04:35 +0100 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-27 10:59:39 +0100 |
commit | a5d707e18ff5f14eb8c185d142cc068162ff821b (patch) | |
tree | be56da6fd1ed1683a203a68e5b4659e9a682906d /sw-ui-kt | |
parent | Fix lobby updates (diff) | |
download | seven-wonders-a5d707e18ff5f14eb8c185d142cc068162ff821b.tar.gz seven-wonders-a5d707e18ff5f14eb8c185d142cc068162ff821b.tar.bz2 seven-wonders-a5d707e18ff5f14eb8c185d142cc068162ff821b.zip |
Rename action classes for consistency
Diffstat (limited to 'sw-ui-kt')
7 files changed, 18 insertions, 18 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/CreateGameForm.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/CreateGameForm.kt index a761b6f2..3b125df5 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/CreateGameForm.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/CreateGameForm.kt @@ -12,7 +12,7 @@ import kotlinx.css.display import kotlinx.css.flexDirection import kotlinx.css.justifyContent import kotlinx.html.js.onSubmitFunction -import org.luxons.sevenwonders.ui.redux.RequestCreateGameAction +import org.luxons.sevenwonders.ui.redux.RequestCreateGame import org.luxons.sevenwonders.ui.redux.connectDispatch import org.w3c.dom.HTMLInputElement import org.w3c.dom.events.Event @@ -73,5 +73,5 @@ private class CreateGameForm(props: CreateGameFormProps): RComponent<CreateGameF } val createGameForm: RClass<RProps> = connectDispatch(CreateGameForm::class) { dispatch, _ -> - createGame = { name -> dispatch(RequestCreateGameAction(name)) } + createGame = { name -> dispatch(RequestCreateGame(name)) } } diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt index 10d5c868..e2e70869 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt @@ -17,7 +17,7 @@ import kotlinx.html.classes import kotlinx.html.title import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.model.api.State -import org.luxons.sevenwonders.ui.redux.RequestJoinGameAction +import org.luxons.sevenwonders.ui.redux.RequestJoinGame import org.luxons.sevenwonders.ui.redux.connectStateAndDispatch import react.RBuilder import react.RComponent @@ -121,6 +121,6 @@ val gameList = connectStateAndDispatch<GameListStateProps, GameListDispatchProps games = state.games }, mapDispatchToProps = { dispatch, _ -> - joinGame = { gameId -> dispatch(RequestJoinGameAction(gameId = gameId)) } + joinGame = { gameId -> dispatch(RequestJoinGame(gameId = gameId)) } } ) diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt index 668a41c2..45c9ca11 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt @@ -4,7 +4,7 @@ import com.palantir.blueprintjs.Intent import com.palantir.blueprintjs.bpButton import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.model.api.PlayerDTO -import org.luxons.sevenwonders.ui.redux.RequestStartGameAction +import org.luxons.sevenwonders.ui.redux.RequestStartGame import org.luxons.sevenwonders.ui.redux.connectStateAndDispatch import react.RBuilder import react.RComponent @@ -60,6 +60,6 @@ private val lobby = connectStateAndDispatch<LobbyStateProps, LobbyDispatchProps, currentPlayer = state.currentPlayer }, mapDispatchToProps = { dispatch, _ -> - startGame = { dispatch(RequestStartGameAction()) } + startGame = { dispatch(RequestStartGame()) } } ) diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Actions.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Actions.kt index e5c2b13e..43b8aace 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Actions.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Actions.kt @@ -21,8 +21,6 @@ data class EnterGameAction(val gameId: Long): RAction data class TurnInfoEvent(val players: Map<String, PlayerDTO>): RAction -data class PrepareMoveAction(val move: PlayerMove): RAction - data class PreparedCardEvent(val card: PreparedCard): RAction data class PlayerReadyEvent(val username: String): RAction diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt index dc959a2f..e10dcf4d 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt @@ -6,14 +6,16 @@ import redux.RAction data class RequestChooseName(val playerName: String): RAction -data class RequestCreateGameAction(val gameName: String): RAction +data class RequestCreateGame(val gameName: String): RAction -data class RequestJoinGameAction(val gameId: Long): RAction +data class RequestJoinGame(val gameId: Long): RAction data class RequestReorderPlayers(val orderedPlayers: List<String>): RAction data class RequestUpdateSettings(val settings: CustomizableSettings): RAction -class RequestStartGameAction: RAction +class RequestStartGame: RAction -data class PrepareMove(val move: PlayerMove): RAction +class RequestSayReady: RAction + +data class RequestPrepareMove(val move: PlayerMove): RAction diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameBrowserSagas.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameBrowserSagas.kt index 38c3e60a..d6555c26 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameBrowserSagas.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameBrowserSagas.kt @@ -7,8 +7,8 @@ import org.hildan.krossbow.stomp.StompSubscription import org.luxons.sevenwonders.client.SevenWondersSession import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.ui.redux.EnterLobbyAction -import org.luxons.sevenwonders.ui.redux.RequestCreateGameAction -import org.luxons.sevenwonders.ui.redux.RequestJoinGameAction +import org.luxons.sevenwonders.ui.redux.RequestCreateGame +import org.luxons.sevenwonders.ui.redux.RequestJoinGame import org.luxons.sevenwonders.ui.redux.UpdateGameListAction import org.luxons.sevenwonders.ui.router.Navigate import org.luxons.sevenwonders.ui.router.Route @@ -39,12 +39,12 @@ private class GameBrowserSaga( private suspend fun awaitCreateOrJoinGame(): LobbyDTO = awaitFirst(this::awaitCreateGame, this::awaitJoinGame) private suspend fun awaitCreateGame(): LobbyDTO { - val action = sagaContext.next<RequestCreateGameAction>() + val action = sagaContext.next<RequestCreateGame>() return session.createGame(action.gameName) } private suspend fun awaitJoinGame(): LobbyDTO { - val action = sagaContext.next<RequestJoinGameAction>() + val action = sagaContext.next<RequestJoinGame>() return session.joinGame(action.gameId) } } diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/LobbySagas.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/LobbySagas.kt index b081e61d..a51648c8 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/LobbySagas.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/LobbySagas.kt @@ -6,7 +6,7 @@ import org.hildan.krossbow.stomp.StompSubscription import org.luxons.sevenwonders.client.SevenWondersSession import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.ui.redux.EnterGameAction -import org.luxons.sevenwonders.ui.redux.RequestStartGameAction +import org.luxons.sevenwonders.ui.redux.RequestStartGame import org.luxons.sevenwonders.ui.redux.UpdateLobbyAction import org.luxons.sevenwonders.ui.router.Navigate import org.luxons.sevenwonders.ui.router.Route @@ -36,6 +36,6 @@ private suspend fun SwSagaContext.awaitGameStart(session: SevenWondersSession, l } private suspend fun SwSagaContext.awaitStartGame(session: SevenWondersSession) { - next<RequestStartGameAction>() + next<RequestStartGame>() session.startGame() } |