metro-rts/src/goap/actor_world_state.cpp

24 lines
671 B
C++

#include "actor_world_state.hpp"
#ifdef DEBUG_ENABLED
#include "godot_cpp/variant/utility_functions.hpp"
#endif
namespace goap {
void ActorWorldState::_bind_methods() {
#define CLASSNAME ActorWorldState
}
bool ActorWorldState::check_property_match(WorldProperty const &property) {
return this->get_world_property(property.key) == property.value;
}
gd::Variant ActorWorldState::get_world_property(gd::String world_prop_name) {
#ifdef DEBUG_ENABLED
if(!this->has_method("get_" + world_prop_name)) {
gd::UtilityFunctions::push_error("tried to get nonexistent property ", world_prop_name);
}
#endif
return this->call("get_" + world_prop_name);
}
}