/// <summary> /// Returns true if ResponseMapInfoFeatures instances are equal /// </summary> /// <param name="other">Instance of ResponseMapInfoFeatures to be compared</param> /// <returns>Boolean</returns> public bool Equals(ResponseMapInfoFeatures other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( PublicTransport == other.PublicTransport || PublicTransport != null && PublicTransport.Equals(other.PublicTransport) ) && ( Fares == other.Fares || Fares.Equals(other.Fares) ) && ( Postcodes == other.Postcodes || Postcodes.Equals(other.Postcodes) )); }
/// <summary> /// Returns true if ResponseRoutesProperties instances are equal /// </summary> /// <param name="other">Instance of ResponseRoutesProperties to be compared</param> /// <returns>Boolean</returns> public bool Equals(ResponseRoutesProperties other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TravelTime == other.TravelTime || TravelTime.Equals(other.TravelTime) ) && ( Distance == other.Distance || Distance.Equals(other.Distance) ) && ( Fares == other.Fares || Fares != null && Fares.Equals(other.Fares) ) && ( Route == other.Route || Route != null && Route.Equals(other.Route) )); }
/// <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 :) hashCode = hashCode * 59 + TravelTime.GetHashCode(); hashCode = hashCode * 59 + Distance.GetHashCode(); if (DistanceBreakdown != null) { hashCode = hashCode * 59 + DistanceBreakdown.GetHashCode(); } if (Fares != null) { hashCode = hashCode * 59 + Fares.GetHashCode(); } if (Route != null) { hashCode = hashCode * 59 + Route.GetHashCode(); } return(hashCode); } }
internal void AssignFare(Fares fares) { var originDestination = GetOriginDestination(); if (OriginDestination.HasNoJourney(originDestination)) { return; } _fare = fares(originDestination); }
/// <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 (PublicTransport != null) { hashCode = hashCode * 59 + PublicTransport.GetHashCode(); } hashCode = hashCode * 59 + Fares.GetHashCode(); hashCode = hashCode * 59 + Postcodes.GetHashCode(); return(hashCode); } }
internal void AssignFare(Fares fares) { _fare = fares(_origin, _destination); }
internal void AssignFare(Fares fares) { _memento.Fare = fares(_memento.Origin, _memento.Destination); }