parent
b9025be45b
commit
dcf1a4020d
@ -0,0 +1,16 @@ |
||||
#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 |
Loading…
Reference in new issue