public override int GetHashCode() { unchecked { var hashCode = ActivePlaytime.GetHashCode(); hashCode = (hashCode * 397) ^ (int)MatchEndReason; hashCode = (hashCode * 397) ^ (PlayerStates?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (TeamStates?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)VictoryCondition; return(hashCode); } }
public bool Equals(MatchEnd other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(false); } return(ActivePlaytime.Equals(other.ActivePlaytime) && MatchEndReason == other.MatchEndReason && PlayerStates.OrderBy(ps => ps.Key).SequenceEqual(other.PlayerStates.OrderBy(ps => ps.Key)) && TeamStates.OrderBy(ts => ts.Key).SequenceEqual(other.TeamStates.OrderBy(ts => ts.Key)) && VictoryCondition == other.VictoryCondition); }