/// <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()); }
/// <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()); }
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); } }
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); } }
/// <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()); }