Beispiel #1
0
 /// <summary>
 /// Serves as the default hash function.
 /// </summary>
 /// <returns>
 /// A hash code for the current object.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AutoIncreaseSpeed.GetHashCode();
         hashCode = (hashCode * 397) ^ GameSpeed.GetHashCode();
         hashCode = (hashCode * 397) ^ (LeftPaddleType != null ? LeftPaddleType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (RightPaddleType != null ? RightPaddleType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ BallCount;
         hashCode = (hashCode * 397) ^ TimeLimit.GetHashCode();
         hashCode = (hashCode * 397) ^ ScoreLimit;
         return(hashCode);
     }
 }