mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user