예제 #1
0
        public override int GetHashCode(SpatialEqualityOptions options)
        {
            unchecked
            {
                var latitude  = Latitude;
                var longitude = Longitude;

                if (options.PoleCoordiantesAreEqual && (Latitude.Equals(90) || Latitude.Equals(-90)))
                {
                    longitude = 0;
                }
                else if (options.AntiMeridianCoordinatesAreEqual && Longitude.Equals(-180))
                {
                    longitude = 180;
                }

                var hashCode = latitude.GetHashCode();
                hashCode = (hashCode * 397) ^ longitude.GetHashCode();
                if (options.UseElevation)
                {
                    hashCode = (hashCode * 397) ^ Elevation.GetHashCode();
                }
                if (options.UseM)
                {
                    hashCode = (hashCode * 397) ^ Measure.GetHashCode();
                }
                return(hashCode);
            }
        }
예제 #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Elevation != null)
         {
             hashCode = hashCode * 59 + Elevation.GetHashCode();
         }
         if (Latitude != null)
         {
             hashCode = hashCode * 59 + Latitude.GetHashCode();
         }
         if (Longitude != null)
         {
             hashCode = hashCode * 59 + Longitude.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked     // Overflow is fine, just wrap
     {
         int hash = 17;
         hash = hash * 23 + Elevation.GetHashCode();
         hash = hash * 23 + ColumnId.GetHashCode();
         return(hash);
     }
 }
예제 #4
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Azimuth.GetHashCode();
         hashCode = (hashCode * 397) ^ Elevation.GetHashCode();
         hashCode = (hashCode * 397) ^ Range.GetHashCode();
         hashCode = (hashCode * 397) ^ RangeRate.GetHashCode();
         return(hashCode);
     }
 }
예제 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Identifier.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FIPSCountryId != null ? FIPSCountryId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CallSign != null ? CallSign.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Latitude.GetHashCode();
         hashCode = (hashCode * 397) ^ Longitude.GetHashCode();
         hashCode = (hashCode * 397) ^ Elevation.GetHashCode();
         hashCode = (hashCode * 397) ^ Begin.GetHashCode();
         hashCode = (hashCode * 397) ^ End.GetHashCode();
         return(hashCode);
     }
 }