public bool Equals(PlayerMatch other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(ExperienceProgress, other.ExperienceProgress) && GameMode == other.GameMode && LeaderId == other.LeaderId && string.Equals(MapId, other.MapId) && MatchId.Equals(other.MatchId) && Equals(MatchStartDate, other.MatchStartDate) && MatchType == other.MatchType && PlayerCompletedMatch == other.PlayerCompletedMatch && PlayerIndex == other.PlayerIndex && PlayerMatchDuration.Equals(other.PlayerMatchDuration) && PlayerMatchOutcome == other.PlayerMatchOutcome && PlaylistId.Equals(other.PlaylistId) && Equals(RatingProgress, other.RatingProgress) && SeasonId.Equals(other.SeasonId) && TeamId == other.TeamId && TeamPlayerIndex == other.TeamPlayerIndex && Teams.OrderBy(t => t.Key).SequenceEqual(other.Teams.OrderBy(t => t.Key))); }
public override int GetHashCode() { unchecked { var hashCode = (ExperienceProgress != null ? ExperienceProgress.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)GameMode; hashCode = (hashCode * 397) ^ LeaderId; hashCode = (hashCode * 397) ^ (MapId?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ MatchId.GetHashCode(); hashCode = (hashCode * 397) ^ (MatchStartDate != null ? MatchStartDate.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)MatchType; hashCode = (hashCode * 397) ^ PlayerCompletedMatch.GetHashCode(); hashCode = (hashCode * 397) ^ PlayerIndex; hashCode = (hashCode * 397) ^ PlayerMatchDuration.GetHashCode(); hashCode = (hashCode * 397) ^ (int)PlayerMatchOutcome; hashCode = (hashCode * 397) ^ PlaylistId.GetHashCode(); hashCode = (hashCode * 397) ^ (RatingProgress != null ? RatingProgress.GetHashCode() : 0); hashCode = (hashCode * 397) ^ SeasonId.GetHashCode(); hashCode = (hashCode * 397) ^ TeamId; hashCode = (hashCode * 397) ^ TeamPlayerIndex; hashCode = (hashCode * 397) ^ (Teams?.GetHashCode() ?? 0); return(hashCode); } }