| 293 | } |
| 294 | |
| 295 | NodeStatus BehaviorState::runSequence(SequenceNode const& node, NodeState& state) { |
| 296 | if (state.isNothing()) |
| 297 | state.set(CompositeState(node.children.size())); |
| 298 | |
| 299 | CompositeState& composite = state->get<CompositeState>(); |
| 300 | while (composite.index < node.children.size()) { |
| 301 | auto child = node.children.get(composite.index); |
| 302 | NodeStatus childStatus = runNode(*child, *composite.children[composite.index]); |
| 303 | |
| 304 | if (childStatus == NodeStatus::Failure || childStatus == NodeStatus::Running) |
| 305 | return childStatus; |
| 306 | else |
| 307 | composite.index++; |
| 308 | } |
| 309 | |
| 310 | return NodeStatus::Success; |
| 311 | } |
| 312 | |
| 313 | NodeStatus BehaviorState::runSelector(SelectorNode const& node, NodeState& state) { |
| 314 | if (state.isNothing()) |
nothing calls this directly
no test coverage detected