using UnityEngine; namespace UIWidgets { /// /// List node. /// public class ListNode { /// /// The depth. /// public int Depth; /// /// The node. /// public TreeNode Node; /// /// Initializes a new instance of the class. /// /// Node. /// Depth. public ListNode(TreeNode node, int depth) { Node = node; Depth = depth; } /// /// Determines whether the specified object is equal to the current object. /// /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. public override bool Equals(System.Object obj) { var nodeObj = obj as ListNode; if (nodeObj==null) { return this==null; } if (this==null) { return false; } return Node.Equals(nodeObj.Node); } /// /// Serves as a hash function for a particular type. /// /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table. public override int GetHashCode() { return base.GetHashCode(); } /// /// Returns true if the nodes items are equal, false otherwise. /// /// The alpha component. /// The blue component. public static bool operator ==(ListNode a, ListNode b) { var a_null = object.ReferenceEquals(null, a); var b_null = object.ReferenceEquals(null, b); if (a_null && b_null) { return true; } if (a_null!=b_null) { return false; } return a.Node.Equals(b.Node); } /// /// Returns true if the nodes items are not equal, false otherwise. /// /// The alpha component. /// The blue component. public static bool operator !=(ListNode a, ListNode b) { var a_null = object.ReferenceEquals(null, a); var b_null = object.ReferenceEquals(null, b); if (a_null && b_null) { return false; } if (a_null!=b_null) { return true; } return !a.Node.Equals(b.Node); } } }