FSO.IDE.EditorComponent.UI.BHAVContainer.recurseTree C# (CSharp) Method

recurseTree() private method

private recurseTree ( HashSet notTraversed, List instructionTree, PrimitiveBox primUI, byte depth ) : void
notTraversed HashSet
instructionTree List
primUI PrimitiveBox
depth byte
return void
        private void recurseTree(HashSet<PrimitiveBox> notTraversed, List<List<PrimitiveBox>> instructionTree, PrimitiveBox primUI, byte depth)
        {
            if (primUI == null || !notTraversed.Contains(primUI)) return;

            while (depth >= instructionTree.Count) instructionTree.Add(new List<PrimitiveBox>());
            instructionTree[depth].Add(primUI);
            notTraversed.Remove(primUI);

            //traverse false then true branch
            recurseTree(notTraversed, instructionTree, primUI.TrueUI, (byte)(depth + 1));
            recurseTree(notTraversed, instructionTree, primUI.FalseUI, (byte)(depth + 1));
        }