void INodeDisplayer <TextBasedNodeDisplayerParams <string> > .DisplayAllNodes(TextBasedNodeDisplayerParams <string> t) { NodeBase <string> currentNode = t.NodeToDisplay; IList <Node <string> > nodesToDisplayOnSingleLine = new List <Node <string> >(); //TODO Implement //while(currentNode != null) //{ // if(currentNode.ParentNode == null) // { // Console.WriteLine(currentNode.Value.PadLeft(((IDisplayableNode)currentNode).DisplayPosition)); // if(currentNode.LeftChild != null) // { // nodesToDisplayOnSingleLine.Add((Node<string>)currentNode); // } // if(currentNode.RightChild != null) // { // nodesToDisplayOnSingleLine.Add((Node<string>)currentNode); // } // Console.WriteLine(getFormattedNodeValuesDisplayLine(nodesToDisplayOnSingleLine)); // currentNode = currentNode.LeftChild ?? currentNode.RightChild; // } // else // { // if (currentNode.LeftChild != null) // { // nodesToDisplayOnSingleLine.Add((Node<string>)currentNode); // } // if (currentNode.RightChild != null) // { // nodesToDisplayOnSingleLine.Add((Node<string>)currentNode); // } // if(currentNode.ParentNode != null) // { // } // } //} //throw new NotImplementedException(); ////Print root node on line 1 //// left child line 2 //// right child line 2 //// }
void INodeDisplayer <TextBasedNodeDisplayerParams <string> > .SetNodePrintPosition(TextBasedNodeDisplayerParams <string> t) { ((IDisplayableNode)t.NodeToDisplay).DisplayPosition = getNodeLeftPadValue(t.NodeToDisplay); }