/// <summary> /// Hash the node. /// </summary> public override int GetHashCode() { int hash = vesselId.GetHashCode(); //TODO: InternalNode should not be null, but Remove could set it to null if (InternalNode != null) { hash ^= InternalNode.GetHashCode(); } return(hash); }
/// <summary> /// Hash code for the object. /// </summary> public override int GetHashCode() { var hash = type.GetHashCode(); if (body != null) { hash ^= body.name.GetHashCode(); } hash ^= vesselId.GetHashCode(); if (node != null) { hash ^= node.GetHashCode(); } hash ^= partId.GetHashCode(); if (dockingPort != null) { hash ^= dockingPort.GetHashCode(); } if (thruster != null) { hash ^= thruster.GetHashCode(); } if (parent != null) { hash ^= parent.GetHashCode(); } if (type == ReferenceFrameType.Relative) { hash ^= relativePosition.GetHashCode(); hash ^= relativeRotation.GetHashCode(); hash ^= relativeVelocity.GetHashCode(); hash ^= relativeAngularVelocity.GetHashCode(); } if (type == ReferenceFrameType.Hybrid) { hash ^= hybridPosition.GetHashCode(); hash ^= hybridRotation.GetHashCode(); hash ^= hybridVelocity.GetHashCode(); hash ^= hybridAngularVelocity.GetHashCode(); } return(hash); }
/// <summary> /// Hash the reference frame. /// </summary> public override int GetHashCode() { var hash = type.GetHashCode(); if (body != null) { hash ^= body.name.GetHashCode(); } hash ^= vesselId.GetHashCode(); if (node != null) { hash ^= node.GetHashCode(); } hash ^= partId.GetHashCode(); if (dockingPort != null) { hash ^= dockingPort.GetHashCode(); } return(hash); }