summaryrefslogtreecommitdiff
path: root/frontend/src/redux/actions
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2019-02-24 01:50:26 +0100
committerjbion <joffrey.bion@amadeus.com>2019-02-24 01:50:26 +0100
commit3c8b01f3ab690362268aace634e574c1a7b63888 (patch)
treea8c955ebd9b1f5290422c725f68f50e7067d0e09 /frontend/src/redux/actions
parentImprove GameScene by showing the hand (diff)
downloadseven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.tar.gz
seven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.tar.bz2
seven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.zip
Add prepare move actions
Diffstat (limited to 'frontend/src/redux/actions')
-rw-r--r--frontend/src/redux/actions/game.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/frontend/src/redux/actions/game.js b/frontend/src/redux/actions/game.js
index 1fe49dfb..434aa8d3 100644
--- a/frontend/src/redux/actions/game.js
+++ b/frontend/src/redux/actions/game.js
@@ -1,7 +1,8 @@
-import type { ApiPlayerTurnInfo, ApiPreparedCard, ApiTable } from '../../api/model';
+import type { ApiPlayerMove, ApiPlayerTurnInfo, ApiPreparedCard, ApiTable } from '../../api/model';
export const types = {
REQUEST_SAY_READY: 'GAME/REQUEST_SAY_READY',
+ REQUEST_PREPARE_MOVE: 'GAME/REQUEST_PREPARE_MOVE',
PLAYER_READY_RECEIVED: 'GAME/PLAYER_READY_RECEIVED',
TABLE_UPDATE_RECEIVED: 'GAME/TABLE_UPDATE_RECEIVED',
PREPARED_CARD_RECEIVED: 'GAME/PREPARED_CARD_RECEIVED',
@@ -9,15 +10,23 @@ export const types = {
};
export type SayReadyAction = { type: 'GAME/REQUEST_SAY_READY' };
+export type PrepareMoveAction = { type: 'GAME/REQUEST_PREPARE_MOVE', move: ApiPlayerMove };
export type PlayerReadyEvent = { type: 'GAME/PLAYER_READY_RECEIVED', username: string };
export type TableUpdateEvent = { type: 'GAME/TABLE_UPDATE_RECEIVED', table: ApiTable };
export type PreparedCardEvent = { type: 'GAME/PREPARED_CARD_RECEIVED', card: ApiPreparedCard };
export type TurnInfoEvent = { type: 'GAME/TURN_INFO_RECEIVED', turnInfo: ApiPlayerTurnInfo };
-export type GameAction = SayReadyAction | PlayerReadyEvent | TableUpdateEvent | PreparedCardEvent | TurnInfoEvent;
+export type GameAction =
+ SayReadyAction
+ | PrepareMoveAction
+ | PlayerReadyEvent
+ | TableUpdateEvent
+ | PreparedCardEvent
+ | TurnInfoEvent;
export const actions = {
sayReady: () => ({ type: types.REQUEST_SAY_READY }),
+ prepareMove: (move: ApiPlayerMove) => ({ type: types.REQUEST_PREPARE_MOVE, move }),
receivePlayerReady: (username: string) => ({ type: types.PLAYER_READY_RECEIVED, username }),
receiveTableUpdate: (table: ApiTable) => ({ type: types.TABLE_UPDATE_RECEIVED, table }),
receivePreparedCard: (card: ApiPreparedCard) => ({ type: types.PREPARED_CARD_RECEIVED, card }),
bgstack15