20 #ifndef ANTKEEPER_AI_BT_NODE_HPP
21 #define ANTKEEPER_AI_BT_NODE_HPP
123 return function(context);
143 for (
int i = 0; i < n; ++i)
164 status child_status = child->execute(context);
176 status child_status = child->execute(context);
status
Behavior tree node return status enumerations.
@ success
Indicates a node's execution has succeeded.
@ failure
Indicates a node's execution has failed.
Artificial intelligence (AI)
Executes a function on a context and returns the status.
virtual status execute(node< T >::context_type &context) const final
std::function< status(node< T >::context_type &)> function_type
A node that can have one or more children.
std::list< node< T > * > children
Evaluates a boolean condition (predicate) and returns either status::success or status::failure.
virtual status execute(node< T >::context_type &context) const final
std::function< status(const node< T >::context_type &)> predicate_type
A node with exactly one child.
Executes a child node and returns its inverted status. If the child returns status::success,...
virtual status execute(node< T >::context_type &context) const final
Abstract base class for behavior tree nodes.
virtual status execute(context_type &context) const =0
Executes a node's function and returns its status.
T context_type
Data type on which nodes operate.
Attempts to execute a child node n times or until the child fails.
virtual status execute(node< T >::context_type &context) const final
Attempts to execute each child node sequentially until one succeeds. If a child succeeds,...
virtual status execute(node< T >::context_type &context) const final
Attempts to execute each child node sequentially until one fails. If all children are executed succes...
virtual status execute(node< T >::context_type &context) const final
Executes a child node and returns status::success regardless of the child node status.
virtual status execute(node< T >::context_type &context) const final