iegoal.h

来自「C人工智能游戏开发的一些实例源代码 C Game development in 」· C头文件 代码 · 共 48 行

H
48
字号

#ifndef _IEGOAL_H_
#define _IEGOAL_H_

#include <list>
#include <string>

class IERule;
class IEExec;
class IE;

class IEGoal
{

friend IE;
friend IERule;

public:
    IEGoal  ( IEExec * goalExec);
    ~IEGoal ();

    void         addRule         ( IERule * rule );
    void         setStart        ( bool start );
    bool         atStart         ();
    bool         start           ();
    void         setFinish       ( bool finish );
    bool         atFinish        ();
    bool         finish          ();
    void         reset           ();
    void         destroyRules    ();
    bool         update          ();
    const char * getName         ();
    void         resetFiredRules ();

private:
    std::string m_name;             // goal name

    IEExec    * m_goalExec;         // goal executor

    std::list<IERule *> m_rules;    // list of rules for this goal

    IEGoal    * m_lastGoal;         // goal that had control before this goal

    bool        m_start;            // start  flag
    bool        m_finish;           // finish flag
};

#endif

⌨️ 快捷键说明

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