示例#1
0
 /// <summary>
 /// Serves as a hash function for a <see cref="osuTK.Input.GamePadCapabilities"/> 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
         (buttons.GetHashCode() ^
          IsConnected.GetHashCode() ^
          IsMapped.GetHashCode() ^
          gamepad_type.GetHashCode());
 }
示例#2
0
 /// <summary>
 /// Serves as a hash function for a <see cref="OpenTK.Input.JoystickCapabilities"/> 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
         (AxisCount.GetHashCode() ^
          ButtonCount.GetHashCode() ^
          HatCount.GetHashCode() ^
          IsConnected.GetHashCode() ^
          SupportsHaptics.GetHashCode());
 }
示例#3
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = Name?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Team?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CarId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CarSkinId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ IsConnected.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBookedForPlayer.GetHashCode();
         return(hashCode);
     }
 }
示例#4
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hash = (int)2166136261;
                // Suitable nullity checks etc, of course :)
                hash = (hash * 16777619) ^ ClientId.GetHashCode();
                hash = (hash * 16777619) ^ CleanSession.GetHashCode();
                hash = (hash * 16777619) ^ ClientIndex.GetHashCode();
                hash = (hash * 16777619) ^ IsConnected.GetHashCode();
                if (WillFlag)
                {
                    hash = (hash * 16777619) ^ WillFlag.GetHashCode();
                    hash = (hash * 16777619) ^ WillMessage.GetHashCode();
                    hash = (hash * 16777619) ^ WillQosLevel.GetHashCode();
                    hash = (hash * 16777619) ^ WillRetain.GetHashCode();
                    hash = (hash * 16777619) ^ WillTopic.GetHashCode();
                }

                return(hash);
            }
        }
示例#5
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());
 }