MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / runSequence

Method runSequence

source/game/StarBehaviorState.cpp:295–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295NodeStatus 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
313NodeStatus BehaviorState::runSelector(SelectorNode const& node, NodeState& state) {
314 if (state.isNothing())

Callers

nothing calls this directly

Calls 5

CompositeStateClass · 0.85
isNothingMethod · 0.80
setMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected