コード例 #1
0
ファイル: ControlSettings.cs プロジェクト: DonkerNet/pong
 /// <summary>
 /// Serves as the default hash function.
 /// </summary>
 /// <returns>
 /// A hash code for the current object.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         return(((LeftPaddle != null ? LeftPaddle.GetHashCode() : 0) * 397) ^ (RightPaddle != null ? RightPaddle.GetHashCode() : 0));
     }
 }
コード例 #2
0
ファイル: ControlSettings.cs プロジェクト: DonkerNet/pong
 /// <summary>
 /// Creates a new <see cref="ControlSettings"/> object that is a copy of the current instance.
 /// </summary>
 /// <returns>A new <see cref="ControlSettings"/> object that is a copy of this instance.</returns>
 public ControlSettings Clone()
 {
     return(new ControlSettings
     {
         LeftPaddle = LeftPaddle != null?LeftPaddle.Clone() : null,
                          RightPaddle = RightPaddle != null?RightPaddle.Clone() : null
     });
 }