internal static void Build(ref int i, ref int j, ref Action<Tree> buildAction, Tree t, int depth) { if (i < j) { i++; buildAction(t); Build(ref i,ref j,ref buildAction,t, depth); } }
private static void Print(Tree t, ref int count, ref System.IO.StreamWriter sw) { foreach (Tree T in t._children) { count++; sw.WriteLine( GetTabDepth(T._depth, " ") + "Parent: " + (T._parent != null ? T._parent._id.ToString() : "Has no parents.") + " | Node: " + T._id.ToString() + " | depth: " + T._depth); Print(T, ref count, ref sw); } }
private void Draw(Tree t) { if( t._children!=null && t._children.Count!=0 ) foreach (Tree T in t._children) { DrawToScreen( T ); Draw( T ); } }
internal static void Build(Action<Tree, int> buildAction, Tree t, ref Random r, Func<Random, bool> addCondition, bool Add) { if (addCondition(r)) { buildAction(t, t._depth + 1); foreach (Tree T in t._children) Build(buildAction, T, ref r, addCondition, addCondition(r)); } }
private void DrawToScreen(Tree T) { SolidColorBrush b = new SolidColorBrush(Windows.UI.Colors.White); }
public void AddChild(Tree t) { _children.Add(t); }