From 22d99e6b8d6e279dbea0892afafb0dc24c00d57d Mon Sep 17 00:00:00 2001 From: Evan Hemsley <2342303+ehemsley@users.noreply.github.com> Date: Tue, 31 Dec 2019 17:57:38 -0800 Subject: [PATCH] move MakeLong to SpatialHash --- Bonk/BroadPhase/SpatialHash.cs | 9 +++++++-- Bonk/LongHelper.cs | 10 ---------- 2 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 Bonk/LongHelper.cs diff --git a/Bonk/BroadPhase/SpatialHash.cs b/Bonk/BroadPhase/SpatialHash.cs index 37d4ef6..0b2982a 100644 --- a/Bonk/BroadPhase/SpatialHash.cs +++ b/Bonk/BroadPhase/SpatialHash.cs @@ -42,7 +42,7 @@ namespace MoonTools.Core.Bonk { for (var j = minHash.Item2; j <= maxHash.Item2; j++) { - var key = LongHelper.MakeLong(i, j); + var key = MakeLong(i, j); if (!hashDictionary.ContainsKey(key)) { hashDictionary.Add(key, new HashSet()); @@ -67,7 +67,7 @@ namespace MoonTools.Core.Bonk { for (int j = minHash.Item2; j <= maxHash.Item2; j++) { - var key = LongHelper.MakeLong(i, j); + var key = MakeLong(i, j); if (hashDictionary.ContainsKey(key)) { foreach (var t in hashDictionary[key]) @@ -92,5 +92,10 @@ namespace MoonTools.Core.Bonk IDLookup.Clear(); } + + private static long MakeLong(int left, int right) + { + return ((long)left << 32) | ((uint)right); + } } } diff --git a/Bonk/LongHelper.cs b/Bonk/LongHelper.cs deleted file mode 100644 index f3277a3..0000000 --- a/Bonk/LongHelper.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MoonTools.Core.Bonk -{ - public static class LongHelper - { - public static long MakeLong(int left, int right) - { - return ((long)left << 32) | ((uint)right); - } - } -}