Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FSM.Automata.RegisterFSM({
- name: 'chainedwords',
- initial_state: 'create',
- state: ['create', 'play', 'check', 'grab', 'end', 'tileConvert', 'tilesChange', 'waitOpponent', 'invite'],
- transition: [
- {
- event: 'start',
- from: 'create',
- to: 'play'
- },
- {
- event: 'change_tiles',
- from: 'play',
- to: 'tilesChange'
- },
- {
- event: 'wait_player',
- from: 'play',
- to: 'waitOpponent'
- },
- {
- event: 'player_joined',
- from: 'waitOpponent',
- to: 'play'
- },
- {
- event: 'tiles_changed',
- from: 'tilesChange',
- to: 'play'
- },
- {
- event: 'game_ends',
- from: 'tilesChange',
- to: 'end'
- },
- {
- event: 'convert_tile',
- from: 'play',
- to: 'tileConvert'
- },
- {
- event: 'tile_converted',
- from: 'tileConvert',
- to: 'play'
- },
- {
- event: 'play_tiles',
- from: 'play',
- to: 'check'
- },
- {
- event: 'pass',
- from: 'check',
- to: 'play'
- },
- {
- event: 'check_ok',
- from: 'check',
- to: 'grab'
- },
- {
- event: 'check_error',
- from: 'check',
- to: 'play'
- },
- {
- event: 'game_ends',
- from: 'check',
- to: 'end'
- },
- {
- event: 'get_tiles',
- from: 'grab',
- to: 'play'
- },
- {
- event: 'game_ends',
- from: 'grab',
- to: 'end'
- },
- {
- event: 'resign',
- from: 'play',
- to: 'end'
- },
- {
- event: 'resign',
- from: 'waitOpponent',
- to: 'end'
- },
- {
- event: 'wait_accept_invitation',
- from : 'play',
- to : 'invite'
- },
- {
- event : 'invitation_accepted',
- from : 'invite',
- to : 'play'
- },
- {
- event : 'invitation_rejected',
- from : 'invite',
- to : 'end'
- },
- {
- event : 'resign',
- from : 'invite',
- to : 'end'
- },
- {
- event : 'invitation_rejected',
- from : 'play',
- to : 'end'
- },
- {
- event : 'invitation_accepted',
- from : 'play',
- to : 'play'
- },
- {
- event : 'expire',
- from : 'play',
- to : 'end'
- }
- ]
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement