A weird game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
turings-tarpit/fsm.hpp

17 lines
249 B

#pragma once
template<typename S, typename E>
class DeadSimpleFSM {
protected:
S _state = S::START;
public:
virtual void event(E event) = 0;
void state(S next_state) {
_state = next_state;
}
};
#define FSM_T(S, F) case S: F(); break