Last active
March 5, 2021 16:19
-
-
Save leesei/44b6435e109eef92522ef5d908b4f39e 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
// https://xstate.js.org/viz/ | |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const furuyoniMachine = Machine({ | |
id: "furuyoni", | |
initial: "櫻花決鬪", | |
context: { | |
回: 1, | |
距: 10, | |
虛: 0, | |
達人間距: 2, | |
起始距離: 10, | |
PLAYER_A_STATES: {}, | |
PLAYER_B_STATES: {}, | |
}, | |
states: { | |
START_GAME: { | |
on: { | |
AUTO: "雙掌繚亂", | |
}, | |
}, | |
雙掌繚亂: { | |
on: { | |
AUTO: "眼前構築", | |
}, | |
}, | |
眼前構築: { | |
on: { | |
AUTO: "櫻花決鬪", | |
}, | |
}, | |
櫻花決鬪: { | |
initial: "PLAYER_A", | |
states: { | |
PLAYER_A: { | |
on: { | |
PLAYCARD: "PLAYER_B_對應", | |
ENDTURN: "PLAYER_B", | |
DIE: "勝負", | |
}, | |
// states: { | |
// initial: "起始階段", | |
// 起始階段: {}, | |
// 主要階段: {}, | |
// 結束階段: {}, | |
// }, | |
}, | |
PLAYER_A_對應: { | |
on: { | |
PLAYCARD: "PLAYER_B", | |
SKIP: "PLAYER_B", | |
}, | |
}, | |
PLAYER_B: { | |
on: { | |
PLAYCARD: "PLAYER_A_對應", | |
ENDTURN: "PLAYER_A", | |
DIE: "勝負", | |
}, | |
}, | |
PLAYER_B_對應: { | |
on: { | |
PLAYCARD: "PLAYER_A", | |
SKIP: "PLAYER_A", | |
}, | |
}, | |
勝負: { | |
type: "final", | |
}, | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment