Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
GOAPInterface.cpp
Go to the documentation of this file.
1
2
4
5namespace Divide::AI {
6
7GOAPGoal::GOAPGoal(const string& name, const U32 ID)
8 : WorldState(), _relevancy(0.f)
9{
10 _id = ID;
11 name_ = name;
12}
13
14bool GOAPGoal::plan(const GOAPWorldState& worldState,
15 const GOAPActionSet& actionSet)
16{
17 _currentPlan = _planner.plan(worldState, *this, actionSet);
18 eastl::reverse(begin(_currentPlan), end(_currentPlan));
19
20 return !_currentPlan.empty();
21}
22
24 return _currentPlan;
25}
26
27} // namespace Divide::AI
28
const Divide::string & name() const noexcept
Definition: GOAPInterface.h:65
goap::Planner _planner
Definition: GOAPInterface.h:86
GOAPGoal(const Divide::string &name, U32 ID)
const GOAPPlan & getCurrentPlan() const
virtual bool plan(const GOAPWorldState &worldState, const GOAPActionSet &actionSet)
vector< const Action * > plan(const WorldState &start, const WorldState &goal, const vector< const Action * > &actions)
Definition: Planner.cpp:57
A way of describing the "world" at any point in time.
vector< const GOAPAction * > GOAPActionSet
Definition: GOAPInterface.h:49
vector< const GOAPAction * > GOAPPlan
Definition: GOAPInterface.h:50
uint32_t U32