Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BreadthFirstTreeWalk()

virtual bool System.Collections.Generic.SortedSet< T >.BreadthFirstTreeWalk ( TreeWalkPredicate< T > action)
inlinepackagevirtualinherited

Reimplemented in System.Collections.Generic.SortedSet< T >.TreeSubSet.

Definition at line 867 of file SortedSet.cs.

868 {
869 if (root == null)
870 {
871 return true;
872 }
874 queue.Enqueue(root);
875 while (queue.Count != 0)
876 {
877 Node node = queue.Dequeue();
878 if (!action(node))
879 {
880 return false;
881 }
882 if (node.Left != null)
883 {
884 queue.Enqueue(node.Left);
885 }
886 if (node.Right != null)
887 {
888 queue.Enqueue(node.Right);
889 }
890 }
891 return true;
892 }

References System.action, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Runtime.Serialization.Dictionary, and System.Collections.Generic.SortedSet< T >.root.

Referenced by System.Collections.Generic.SortedSet< T >.RemoveWhere().