fsm-avalon
v1.0.5
Published
Avalon game logic state machine for fsm-reducer
Downloads
8
Readme
fsm-avalon
Install
npm install --save fsm-avalon
Usage
const { getFSM, actionCreators } = require('fsm-avalon');
const { reducer, getValidateError, getActions } = getFSM();
let state = reducer({}, actionCreators.startRound());
Actions
// init the game
initGame({
users,
isSetGoddess
});
// start the round
startRound();
// build the knights to mission
buildTeam({
knights
});
// vote
vote({
index,
vote // -1 for reject, 1 for approve
});
// draw votes result
drawVotesResult();
// the knight execute mission
executeMission({
index,
mission // -1 for fail, 1 for success
});
// draw missions result
drawMissionsResult();
// assassin
assassin(index);