/* * File: AState.hpp * Author: jens * * Created on 21. Januar 2015, 05:12 */ #ifndef ASTATE_HPP #define ASTATE_HPP #include "IStateMachine.hpp" class AState { public: AState() : m_pStateMachine(0) { } virtual ~AState() {} void registerStateMachine(IStateMachine *pStateMachine) { m_pStateMachine = pStateMachine; } virtual void onTransition() { printf("%s\n", __PRETTY_FUNCTION__); } protected: void setState(IStateMachine::StateId state) { if(m_pStateMachine) { m_pStateMachine->setState(state); } } private: IStateMachine *m_pStateMachine; }; #endif /* ASTATE_HPP */