Exemple #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Earliest != null)
         {
             hashCode = hashCode * 59 + Earliest.GetHashCode();
         }
         if (Latest != null)
         {
             hashCode = hashCode * 59 + Latest.GetHashCode();
         }
         if (Duration != null)
         {
             hashCode = hashCode * 59 + Duration.GetHashCode();
         }
         if (MaxDrivingTime != null)
         {
             hashCode = hashCode * 59 + MaxDrivingTime.GetHashCode();
         }
         if (InitialDrivingTime != null)
         {
             hashCode = hashCode * 59 + InitialDrivingTime.GetHashCode();
         }
         if (PossibleSplit != null)
         {
             hashCode = hashCode * 59 + PossibleSplit.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #2
0
 /// <summary>
 ///     Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 ///     A hash code for the current <see cref="T:System.Object" />.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = _index;
         hashCode = (hashCode * 397) ^ (Latest?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Overall?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }