using UnityEngine; namespace JungleDB { public class DefaultTreeNode : TreeNode { private List children; private TreeMap attrs; private static readonly List NIL_LIST = new List(); public DefaultTreeNode() : this (NIL_LIST, new TreeMap ()) { } public DefaultTreeNode(List _children, TreeMap _attrs) { attrs = _attrs; children = _children; } public TreeNodeChildren getChildren() { return new DefaultTreeNodeChildren(children, attrs); } public TreeNodeAttributes getAttributes() { return new DefaultTreeNodeAttribute(children, attrs); // count = null. } public TreeNode createNewNode() { return new DefaultTreeNode(); } public DefaultTreeNode clone() { return new DefaultTreeNode(children, attrs); } public Either appendRootNode() { TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap()); Either either = newRootChildren.addNewChildAt(0,this); return either; } public int compareTo(TreeNode o) { return this.GetHashCode() - o.GetHashCode(); } } }