#ifndef STATE_MACHINE_H #define STATE_MACHINE_H #include "scene/main/node.h" class State; class StateMachine : public Node { GDCLASS(StateMachine, Node); static void _bind_methods(); void add_state(State *state); void switch_to_state(State *state); void ready(); void process(double delta); protected: void _notification(int what); private: State *current_state{ nullptr }; HashMap states{}; }; #endif // !STATE_MACHINE_H