statemachine.h.svn-base

来自「坦克大战游戏完整全套源代码」· SVN-BASE 代码 · 共 28 行

SVN-BASE
28
字号
#ifndef COMMON_STATE_MACHINE_H
#define COMMON_STATE_MACHINE_H

class StateMachine
{
public:
    typedef unsigned long State;
    enum StateIds
    {
        SI_Enter,    // 初始状态
        SI_Exit,     // 结束

        NumStateIds,
    };
    StateMachine() : currentState(SI_Enter)
    {

    }
    virtual void step();
    State getCurrentState() const
    {
        return currentState;
    }
protected:
    State currentState;
};

#endif//COMMON_STATE_MACHINE_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?