Deep copy of a NaryTree
I am trying to implement a copy constructor for a BehaviorTree (special case NaryTree). The tree is defined as:
And the nodes are derived classes of
I am looking for some direction on how to approach this. I know I could either do an iterative approach using a stack or a queue, or recursive, but I am going back and forth between the two and not sure which would be better for a desktop application.
And the nodes are derived classes of
BehaviorTreeNode (BehaviorTreeSequenceNode, BehaviorTreeSelectorNode, BehaviorTreeExecutorNode). The base class is defined as:I am looking for some direction on how to approach this. I know I could either do an iterative approach using a stack or a queue, or recursive, but I am going back and forth between the two and not sure which would be better for a desktop application.