Exemplo n.º 1
0
        /// <summary>
        /// Hash code for the object.
        /// </summary>
        public override int GetHashCode()
        {
            int hash = Part.GetHashCode() ^ port.GetHashCode();

            if (shield != null)
            {
                hash ^= shield.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Hash the docking ports.
        /// </summary>
        public override int GetHashCode()
        {
            int hash = part.GetHashCode() ^ port.GetHashCode();

            if (shield != null)
            {
                hash ^= shield.GetHashCode();
            }
            if (portNameModule != null)
            {
                hash ^= portNameModule.GetHashCode();
            }
            if (portNameField != null)
            {
                hash ^= portNameField.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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);
        }