diff options
author | jbion <joffrey.bion@amadeus.com> | 2019-02-24 01:50:26 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-02-24 01:50:26 +0100 |
commit | 3c8b01f3ab690362268aace634e574c1a7b63888 (patch) | |
tree | a8c955ebd9b1f5290422c725f68f50e7067d0e09 /frontend/src/sagas/game.js | |
parent | Improve GameScene by showing the hand (diff) | |
download | seven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.tar.gz seven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.tar.bz2 seven-wonders-3c8b01f3ab690362268aace634e574c1a7b63888.zip |
Add prepare move actions
Diffstat (limited to 'frontend/src/sagas/game.js')
-rw-r--r-- | frontend/src/sagas/game.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/src/sagas/game.js b/frontend/src/sagas/game.js index 04209e91..dc92e89a 100644 --- a/frontend/src/sagas/game.js +++ b/frontend/src/sagas/game.js @@ -49,6 +49,13 @@ function* sayReady(session: SevenWondersSession) { } } +function* prepareMove(session: SevenWondersSession) { + while (true) { + let action = yield take(types.REQUEST_PREPARE_MOVE); + yield apply(session, session.prepareMove, [action.move]); + } +} + function* watchTurnInfo(session: SevenWondersSession) { const channel = yield eventChannel(session.watchTurnInfo()); try { @@ -69,6 +76,7 @@ export function* gameSaga(session: SevenWondersSession) { call(watchTableUpdates, session, gameId), call(watchPreparedCards, session, gameId), call(sayReady, session), + call(prepareMove, session), call(watchTurnInfo, session) ]; } |