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

📄 goal.h

📁 很好游戏代码
💻 H
字号:

enum typeGoalStatus { statusSucceeded = 0, statusFailed, statusInProgress };

class Goal
{
public:
	Goal( AI* pAI );
	virtual ~Goal();
	
	// Update the goal
	virtual void Update( float secs_elapsed ) = 0;
	
	typeGoalStatus GoalStatus() { return mGoalStatus; }
	
	virtual void SetStatus(typeGoalStatus GoalStatus) {mGoalStatus = GoalStatus;}
	
	AI* GetAI() { return mpAI; }
	
protected:
	Goal(AI *pAI) : mpAI(pAI), mGoalStatus(statusInProgress){}
	Goal(){mGoalStatus = statusInProgress;}	//for virtual constructor purposes
	AI*           mpAI;		     // The AI we are controlling
	typeGoalStatus mGoalStatus;  // What is are current status (default is statusInProgress)
};


class GoalQueue
{
public:
	GoalQueue();
	virtual ~GoalQueue();
	
	typeGoalStatus UpdateSubgoals( float secs_elapsed );
	bool NoSubgoals() const { return mGoals.empty(); }
	
	void InsertSubgoal (Goal *pGoal); //adds a goal to the front of the queue
	void NewSubgoal( Goal* pGoal ); //adds a goal to the back of the queue
	
	void ResetSubgoals(); //deletes all current subgoals
	
	virtual bool ReplanSubgoals() { return false; }
	
	Goal*   ActiveGoal() { return mGoals.empty() ? NULL : mGoals.front(); }
	
protected:
	std::list<Goal *> mGoals;
};



⌨️ 快捷键说明

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