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

Method runSelector

source/game/StarBehaviorState.cpp:313–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313NodeStatus BehaviorState::runSelector(SelectorNode const& node, NodeState& state) {
314 if (state.isNothing())
315 state.set(CompositeState(node.children.size()));
316
317 CompositeState& composite = state->get<CompositeState>();
318 while (composite.index < node.children.size()) {
319 NodeStatus childStatus = runNode(*node.children[composite.index], *composite.children[composite.index]);
320
321 if (childStatus == NodeStatus::Success || childStatus == NodeStatus::Running)
322 return childStatus;
323 else
324 composite.index++;
325 }
326
327 return NodeStatus::Failure;
328}
329
330NodeStatus BehaviorState::runParallel(ParallelNode const& node, NodeState& state) {
331 if (state.isNothing())

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected