Added missing from ModularizedTacticalAI :/

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6019 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
feynman
2013-04-18 21:14:34 +00:00
parent 26383d83a8
commit aa5bed7850
10 changed files with 439 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#ifndef PLAN_LIST_H_
#define PLAN_LIST_H_
#include "Plan.h"
#include <deque>
namespace AI
{
namespace tactical
{
/**@class PlanList
* @brief Composition/Abstract Product. Used to concatenate plans.
*
* Plan lists can comprise an arbitrary number of sub-plans, executed in the order they were added via
* add_subplan(), and switched to the next one once the done()-flag of a sub-plan becomes true.
*/
class PlanList : public Plan
{
private:
/// The sub-plan sequence
std::deque<Plan*> subplans_;
public:
PlanList(SOLDIERTYPE* npc);
/// Add a plan to the list of sub-plans
virtual void add_subplan(Plan* P);
/// Execute the next plan in the list
virtual void execute(PlanInputData& environment);
/// Done will be set once the last plan is marked as done()
virtual bool done() const;
virtual ~PlanList();
};
}
}
#endif