예제 #1
0
 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);
     }
 }
예제 #2
0
        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);
        }