Example #1
0
 /// <summary>
 /// Serves as a hash function for a <see cref="T:Microsoft.Xna.Framework.Input.GamePadState"/> object.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode()
 {
     unchecked {
         var hash = PacketNumber;
         hash = (hash * 397) ^ Buttons.GetHashCode();
         hash = (hash * 397) ^ DPad.GetHashCode();
         hash = (hash * 397) ^ ThumbSticks.GetHashCode();
         hash = (hash * 397) ^ Triggers.GetHashCode();
         return(hash);
     }
 }
Example #2
0
 /// <summary>
 /// Serves as a hash function for a <see cref="osuTK.Input.GamePadState"/> object.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode()
 {
     return
         (ThumbSticks.GetHashCode() ^ Buttons.GetHashCode() ^
          DPad.GetHashCode() ^ IsConnected.GetHashCode());
 }