diff --git a/src/utils/behavior/composite.rs b/src/utils/behavior/composite.rs index 0c6c7cd94..c07fb5230 100644 --- a/src/utils/behavior/composite.rs +++ b/src/utils/behavior/composite.rs @@ -53,6 +53,22 @@ impl CompositeNode { Self { children, kind } } + /// Creates new sequence composite node with a set of children nodes. + pub fn new_sequence(children: Vec>>) -> Self { + Self { + children, + kind: CompositeNodeKind::Sequence, + } + } + + /// Creates new selector composite node with a set of children nodes. + pub fn new_selector(children: Vec>>) -> Self { + Self { + children, + kind: CompositeNodeKind::Selector, + } + } + /// Adds self to the tree and return handle to self. pub fn add(self, tree: &mut BehaviorTree) -> Handle> { tree.add_node(BehaviorNode::Composite(self))