/* Test the state machine syntax extension */ include "lib_fsm.bmd" void machine_init() { return; } move state0_moveRequest (environment env) { move myMove; myMove.placeBomb = false; myMove.detonate = false; myMove.direction = moveDirection.Void; return myMove; } void state0_bombDetonate (point pos) { return; } void state1_init (point pos) { return; } bool s0pred0 (fsmStateInformation info) { return true; } bool s0pred1 (fsmStateInformation info) { return true; } bool s0pred2 (fsmStateInformation info) { return true; } stateMachine testMachine { stateMachineInit: machine_init; state state0 { onMoveRequest: state0_moveRequest; onBombDetonate: state0_bombDetonate; stateTransition { transitionPredicates: s0pred0,s0pred1; transitionTargets: state1 1.0, state0 2.0; } stateTransition { transitionPredicates: s0pred1,s0pred2; transitionTargets: state1 1.0, state0 3.0; } } state state1 { onInit: state1_init; } } void main() { finiteStateMachine fsm = testMachine(); }