40 lines
874 B
C++
40 lines
874 B
C++
#include "action.hpp"
|
|
|
|
namespace goap {
|
|
Action::~Action() {}
|
|
|
|
bool Action::is_possible(ActorWorldState *context) const {
|
|
return this->procedural_is_possible(context);
|
|
}
|
|
|
|
bool Action::is_completed(ActorWorldState *context) const {
|
|
if(!only_proc_is_completed) {
|
|
for(WorldProperty const &prop : this->effects) {
|
|
if(!context->check_property_match(prop))
|
|
return false;
|
|
}
|
|
}
|
|
return this->procedural_is_completed(context);
|
|
}
|
|
|
|
WorldState const &Action::get_required() const {
|
|
return this->required;
|
|
}
|
|
|
|
WorldState const &Action::get_effects() const {
|
|
return this->effects;
|
|
}
|
|
|
|
ActionID Action::get_id() const {
|
|
return this->id;
|
|
}
|
|
|
|
bool Action::procedural_is_possible(ActorWorldState *context) const {
|
|
return true;
|
|
}
|
|
|
|
bool Action::procedural_is_completed(ActorWorldState *context) const {
|
|
return true;
|
|
}
|
|
}
|