使用tinyfsm
This commit is contained in:
+13
-7
@@ -27,14 +27,20 @@ public:
|
||||
int run(FSM_State &fsm,void* data);
|
||||
int run(FSM_State *fsm,void* data, std::string event);
|
||||
|
||||
//TODO: 事件注册机制实现
|
||||
int RegisterEvent(FSM_State* fsm, std::string event, FSM_State *state);
|
||||
int unRegisterEvent(FSM_State* fsm, std::string event);
|
||||
|
||||
int RegisterState(std::string name, unsigned int id,FSM_State &state);
|
||||
FSM_State getState(std::string name);
|
||||
unsigned int getStateId(std::string name);
|
||||
// 事件处理机制
|
||||
int RegisterEvent(FSM_State* fsm, const std::string& event, FSM_State *state);
|
||||
int unRegisterEvent(FSM_State* fsm, const std::string& event);
|
||||
|
||||
// 状态管理
|
||||
int RegisterState(const std::string& name, unsigned int id, FSM_State &state);
|
||||
FSM_State getState(const std::string& name) const;
|
||||
unsigned int getStateId(const std::string& name) const;
|
||||
|
||||
// 处理函数管理
|
||||
int RegisterHandleFunction(FSM_State* fsm, FSM_Handle handle);
|
||||
int unRegisterHandleFunction(FSM_State* fsm);
|
||||
|
||||
// 事件触发
|
||||
int triggerEvent(FSM_State* currentState, const std::string& event, void* data);
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user