| 375 | } |
| 376 | |
| 377 | NodeStatus BehaviorState::runRandomize(RandomizeNode const& node, NodeState& state) { |
| 378 | if (state.isNothing()) |
| 379 | state.set(CompositeState(node.children.size(), Random::randUInt(node.children.size() - 1))); |
| 380 | |
| 381 | CompositeState& composite = state->get<CompositeState>(); |
| 382 | auto child = node.children.get(composite.index); |
| 383 | NodeStatus status = runNode(*child, *composite.children[composite.index]); |
| 384 | return status; |
| 385 | } |
| 386 | |
| 387 | } |