00001 #ifndef STATEMACHINE_H
00002 #define STATEMACHINE_H
00003
00004 #include "irrlicht.h"
00005
00006 class State;
00007
00009
00014 class StateMachine
00015 {
00016 public:
00020 StateMachine(irr::IrrlichtDevice* d);
00021
00023 ~StateMachine();
00024
00027 void addState(State* s);
00028
00032 void pushEvent(irr::c8* event);
00033
00037 void update(irr::u32 deltaTime);
00038
00040 State* getCurrentState(void);
00041
00045 void startWith(State* s);
00046
00047 protected:
00048
00049 private:
00050
00051 irr::core::stringc popEvent(void);
00052
00053 irr::IrrlichtDevice* device;
00054 irr::core::array<irr::core::stringc> events;
00055 irr::core::array<State*> states;
00056 State* currentState;
00057 };
00058
00059 #endif // STATEMACHINE_H