From bc565456347f3a0c160252741c72adf649700130 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 3 Jun 2026 08:56:07 +0200 Subject: [PATCH] =?UTF-8?q?refactor(physics):=20Stage=201=20=E2=80=94=20wi?= =?UTF-8?q?den=20cell-candidate=20helpers=20to=20ICollection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-behavioral: lets BuildCellSetAndPickContaining pass an ordered CellArray (next commit) while existing HashSet-passing test callers compile unchanged. HashSet and CellArray both implement ICollection. Core builds; 9 helper tests green. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.Core/Physics/CellTransit.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AcDream.Core/Physics/CellTransit.cs b/src/AcDream.Core/Physics/CellTransit.cs index 4a6f964..ae19e70 100644 --- a/src/AcDream.Core/Physics/CellTransit.cs +++ b/src/AcDream.Core/Physics/CellTransit.cs @@ -49,7 +49,7 @@ public static class CellTransit uint currentCellId, Vector3 worldSphereCenter, float sphereRadius, - HashSet candidates, + ICollection candidates, out bool exitOutside) { var spheres = new[] @@ -77,7 +77,7 @@ public static class CellTransit uint currentCellId, IReadOnlyList worldSpheres, int numSpheres, - HashSet candidates, + ICollection candidates, out bool exitOutside) { exitOutside = false; @@ -213,7 +213,7 @@ public static class CellTransit Vector3 worldSphereCenter, float sphereRadius, uint currentCellId, - HashSet candidates) + ICollection candidates) { const float CellSize = 24f; @@ -257,7 +257,7 @@ public static class CellTransit IReadOnlyList worldSpheres, int numSpheres, uint currentCellId, - HashSet candidates) + ICollection candidates) { int sphereCount = EffectiveSphereCount(worldSpheres, numSpheres); for (int i = 0; i < sphereCount; i++) @@ -267,7 +267,7 @@ public static class CellTransit } } - private static void AddOutsideCell(HashSet candidates, uint lbPrefix, int gridX, int gridY) + private static void AddOutsideCell(ICollection candidates, uint lbPrefix, int gridX, int gridY) { if (gridX < 0 || gridX >= 8 || gridY < 0 || gridY >= 8) return; @@ -301,7 +301,7 @@ public static class CellTransit BuildingPhysics building, Vector3 worldSphereCenter, float sphereRadius, - HashSet candidates) + ICollection candidates) { foreach (var portal in building.Portals) {