public RedPointNode GetNode(RedPointType type) { RedPointNode node = null; if (root != null) { node = FindNode(root, type); } return(node); }
private RedPointNode FindNode(RedPointNode source, RedPointType type) { RedPointNode node = null; for (int i = 0; i < source.childs.Count; i++) { node = source.childs[i]; if (node.type != type) { node = FindNode(node, type); if (node != null) { break; } } else { break; } } return(node); }
public void AddChild(RedPointNode node) { this.isLeaf = false; node.parent = this; childs.Add(node); }
public void SetRoot(RedPointNode root) { this.root = root; this.root.isRoot = true; this.root.isLeaf = true; }