22 for (TreeNodes::const_iterator i = _children.begin(); i != _children.end(); ++i) {
23 active.push_back((*i)->getLastStatus(entity) != RUNNING);
30 TreeNodeStatus
execute(
const AIPtr& entity, int64_t deltaMillis)
override {
35 bool totalStatus =
false;
36 for (
const TreeNodePtr& child : _children) {
37 const bool isActive = child->execute(entity, deltaMillis) == RUNNING;
39 child->resetState(entity);
41 totalStatus |= isActive;
47 return state(entity, totalStatus ? RUNNING : FINISHED);
void getRunningChildren(const AIPtr &entity, std::vector< bool > &active) const override
Will only deliver valid results if the debugging for the given entity is active.
Definition: Parallel.h:21
virtual TreeNodeStatus execute(const AIPtr &entity, int64_t deltaMillis)
Definition: TreeNodeImpl.h:184
Base class for all type of TreeNode selectors.
Definition: Selector.h:25
TreeNodeStatus execute(const AIPtr &entity, int64_t deltaMillis) override
If one of the children was executed, and is still running, the ::TreeNodeStatus::RUNNING is returned...
Definition: Parallel.h:30
virtual void resetState(const AIPtr &entity)
Reset the states in the node and also in the entity.
Definition: TreeNodeImpl.h:55
Executes all the connected children in the order they were added (no matter what the TreeNodeStatus o...
Definition: Parallel.h:17