Beispiel #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);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if Break instances are equal
        /// </summary>
        /// <param name="input">Instance of Break to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Break input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Earliest == input.Earliest ||
                     (Earliest != null &&
                      Earliest.Equals(input.Earliest))
                     ) &&
                 (
                     Latest == input.Latest ||
                     (Latest != null &&
                      Latest.Equals(input.Latest))
                 ) &&
                 (
                     Duration == input.Duration ||
                     (Duration != null &&
                      Duration.Equals(input.Duration))
                 ) &&
                 (
                     MaxDrivingTime == input.MaxDrivingTime ||
                     (MaxDrivingTime != null &&
                      MaxDrivingTime.Equals(input.MaxDrivingTime))
                 ) &&
                 (
                     InitialDrivingTime == input.InitialDrivingTime ||
                     (InitialDrivingTime != null &&
                      InitialDrivingTime.Equals(input.InitialDrivingTime))
                 ) &&
                 (
                     PossibleSplit == input.PossibleSplit ||
                     PossibleSplit != null &&
                     PossibleSplit.SequenceEqual(input.PossibleSplit)
                 ));
        }