⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ierule.h

📁 C人工智能游戏开发的一些实例源代码 C Game development in artificial intelligence source code of some examples
💻 H
字号:


#ifndef _IERULE_H_
#define _IERULE_H_

#include <string>

class IE;
class IEExec;
class IEGoal;

class IERule
{

friend IE;
friend IEGoal;

public:

	enum RuleType
	{
		Goto,		// Goto rule   - if condition met, goes to new goal 
		Gosub,	    // Push rule   - if condition met, keeps current goal's 
		            //               rules on a stack and goes to new goal
        Return      // Return rule - if condition met, return to previous goal                  
	};

public:

    IERule  ( IEExec * condition );
    ~IERule ();

    void     setGoal ( IEGoal * goal );
    void     setGoal ( char * name, char * lineInfo );

    IEGoal * getGoal ();

    void     setType ( RuleType type );

    const char * getName () { return m_name.c_str(); }


private:

    std::string m_name;
    std::string m_goalName;
    std::string m_lineInfo;

    IEGoal * m_goal;
    IEExec * m_condition;

    RuleType m_type;

    bool     m_fired; // flag for rule that has been fired (triggered)
};

#endif

⌨️ 快捷键说明

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