From 73fcef7831179f2f05b57d672206749cf8de6759 Mon Sep 17 00:00:00 2001 From: Christopher Whitley Date: Sun, 4 Feb 2024 22:25:00 -0500 Subject: [PATCH] Implement GetHashCode Implements GetHashCode to resolve build warnings. Related to issue https://github.com/MonoGame/monogame.github.io/issues/92 --- MonoGame.Framework/Platform/SDL/SDL2.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MonoGame.Framework/Platform/SDL/SDL2.cs b/MonoGame.Framework/Platform/SDL/SDL2.cs index 44055186f30..5c4efd9b95d 100644 --- a/MonoGame.Framework/Platform/SDL/SDL2.cs +++ b/MonoGame.Framework/Platform/SDL/SDL2.cs @@ -168,6 +168,18 @@ public override bool Equals(object obj) return version == (Version)obj; } + public override int GetHashCode() + { + unchecked + { + int hash = 17; + hash = hash * 23 + Major.GetHashCode(); + hash = hash * 23 + Minor.GetHashCode(); + hash = hash * 23 + Patch.GetHashCode(); + return hash; + } + } + public static bool operator !=(Version version1, Version version2) { return !(version1 == version2);