/// <summary> /// Creates a customizable tree iterator /// </summary> /// <param name="startNode">The node of the tree to start at, or null to start at the root</param> /// <param name="traversalParameters">The custom parameters used to control the traversal</param> /// <returns>The iterator that was created</returns> public TreeIter <TTreeNode> CreateIterator(TTreeNode startNode, TreeTraversalParameters <TTreeNode> traversalParameters) { traversalParameters.Root = this.Root; traversalParameters.SetGetChildrenGetParentOverrideMethods(this.GetChildrenOverride, this.GetParentOverride); return(TreeTraversal <TTreeNode> .CreateIterator(startNode ?? this.Root, traversalParameters)); }
// ----------------------------------------------------------------------------------------------------------------------------------------------------- // =====================================[ Public Instance Functions of TreeTraverser Utilities ] ======================================================= // ----------------------------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Creates a basic tree iterator /// </summary> /// <param name="startNode">The node of the tree to start at (or null to start at the root)</param> /// <param name="flowDirection">The direction to flow through the tree</param> /// <param name="strategy">The traversal strategy to use</param> /// <returns>The iterator that was created</returns> public TreeIter <TTreeNode> CreateIterator(TTreeNode startNode = null, eTraversalFlowDirection flowDirection = TreeTraversal <TTreeNode> .DefaultTraversalFlowDirection, eTraversalStrategy strategy = TreeTraversal <TTreeNode> .DefaultTraversalStrategy) { return(TreeTraversal <TTreeNode> .CreateIterator(this.Root, startNode, flowDirection, strategy, this.GetChildrenOverride, this.GetParentOverride)); }