public void addLevel(MoveNode parent, pieceMove[] data) { for (int i = 0; i < data.Length; i++) { parent.addChild(new MoveNode(parent, data[i], null)); } depth++; }
public bool moveUp() { if (!currNode.Parent.Equals(null)) { this.currNode = currNode.Parent; } return(false); }
public bool moveDown(int index) { MoveNode[] nodes = currNode.getChildNodes().ToArray(); if (nodes.Length <= index && !nodes[index].Equals(null)) { currNode = nodes[index]; return(true); } return(false); }
public bool moveLeft() { int index = -1; MoveNode par = currNode.Parent; MoveNode[] nodes = par.getChildNodes().ToArray(); for (int i = 0; i < nodes.Length; i++) { if (nodes[i] == currNode) { index = i; } } if (index != -1 && index < nodes.Length) { currNode = nodes[index + 1]; return(true); } return(false); }
public void removeChild(MoveNode node) { childNodes.Remove(node); }
public void addChild(MoveNode node) { childNodes.Add(node); }
public MoveNode(MoveNode parent, pieceMove data, List <MoveNode> children) { this.parent = parent; this.data = data; this.childNodes = children; }
public MoveTree(pieceMove headData) { head = new MoveNode(null, headData, null); depth = 0; }