Last active
August 6, 2021 21:13
-
-
Save robertpenner/42cc2c41d90b15f1fa8013c719f2a508 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const machine = Machine({ | |
id: "A Pro-Am Round - Team of 2", | |
type: "parallel", | |
states: { | |
"Player 1 - Amateur": { | |
id: "P1", | |
type: "parallel", | |
states: { | |
hole: { | |
initial: "none", | |
states: { | |
none: { | |
on: { | |
"START ROUND": "hole 1", | |
}, | |
}, | |
"hole 1": { | |
on: { | |
"BALL HOLED BY P2": "hole 2", | |
}, | |
}, | |
"hole 2": { | |
on: { | |
"BALL HOLED BY P2": "hole 18", | |
}, | |
}, | |
"hole 18": { | |
on: { | |
"BALL HOLED BY P1": "done", | |
}, | |
}, | |
done: {}, | |
}, | |
}, | |
status: { | |
initial: "waiting", | |
states: { | |
waiting: { | |
on: { | |
"START ROUND": "playing", | |
"BALL HOLED BY P2": "playing", | |
}, | |
}, | |
playing: { | |
on: { | |
"BALL HOLED BY P1": "waiting", | |
}, | |
}, | |
}, | |
}, | |
}, | |
on: {}, | |
}, | |
"Player 2 - Pro": { | |
id: "P2", | |
type: "parallel", | |
states: { | |
hole: { | |
initial: "none", | |
states: { | |
none: { | |
on: { | |
"BALL HOLED BY P1": "hole 1", | |
}, | |
}, | |
"hole 1": { | |
on: { | |
"BALL HOLED BY P1": "hole 2", | |
}, | |
}, | |
"hole 2": {}, | |
"hole 18": {}, | |
}, | |
}, | |
status: { | |
initial: "waiting", | |
states: { | |
waiting: { | |
on: { | |
"BALL HOLED BY P1": "playing", | |
}, | |
}, | |
playing: { | |
on: { | |
"BALL HOLED BY P2": "waiting", | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
on: { | |
'START ROUND': {}, | |
'BALL HOLED BY P1': {}, | |
'BALL HOLED BY P2': {}, | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment