#state-machine #automata #generator #macro #abstracting #generate #pushdown

pushdown-automaton-macro

Macro generator for state machine, implementing pushdown automaton

1 unstable release

Uses old Rust 2015

0.1.0 Sep 23, 2017

#8 in #abstracting

35 downloads per month

MIT license

9KB
195 lines

state_machine

amethyst.rs state machine generator macro. Made exactly for abstracting over update/handle_events method parameters.

Usage:

state_machine!(StateMachine; State; _world: &mut World, _something: &mut f64);

Will generate StateMachine struct and trait for using with State trait implementations all methods of which should take &mut World and &mut f64 as parameters.

Or something like this: state_machine!( PlayerStateMachine; PlayerState; _mv: &mut MovingObject, _bb: &mut HasAABB, _anim: &mut HasAnimationSequence, _rend: &mut Renderable, _dir: &Directional, _pi: &PlayerInput, _delta: &DeltaTime );

No runtime deps