From 587cebd32c36a426538f14b0f2e31e30db4927aa Mon Sep 17 00:00:00 2001 From: ikpil Date: Tue, 17 Oct 2023 00:24:09 +0900 Subject: [PATCH] feat: added DotRecast.Core.Collections namespace --- .../{ => Collections}/CollectionExtensions.cs | 6 +++--- .../{ => Collections}/RcImmutableArray.Enumerable.cs | 2 +- .../{ => Collections}/RcImmutableArray.Listable.cs | 2 +- .../{ => Collections}/RcImmutableArray.Minimal.cs | 2 +- src/DotRecast.Core/{ => Collections}/RcImmutableArray.cs | 2 +- src/DotRecast.Core/{ => Collections}/RcSortedQueue.cs | 2 +- src/DotRecast.Detour.Crowd/DtCrowd.cs | 1 + src/DotRecast.Detour.Dynamic/DtDynamicTile.cs | 1 + src/DotRecast.Detour/DtNavMeshQuery.cs | 1 + src/DotRecast.Detour/DtNodeQueue.cs | 2 +- src/DotRecast.Detour/DtStraightPathOption.cs | 1 + src/DotRecast.Recast.Demo/Draw/DrawMode.cs | 2 +- src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs | 1 + src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs | 2 +- src/DotRecast.Recast.Demo/UI/RcSettingsView.cs | 3 +-- src/DotRecast.Recast.Demo/UI/RcToolsetView.cs | 2 +- .../Builder/SampleAreaModifications.cs | 2 +- src/DotRecast.Recast.Toolset/Builder/SoloNavMeshBuilder.cs | 2 +- src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs | 1 + .../Tools/RcCrowdAgentProfilingTool.cs | 1 + src/DotRecast.Recast.Toolset/Tools/RcCrowdToolMode.cs | 2 +- .../Tools/RcDynamicUpdateToolMode.cs | 2 +- src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs | 1 + src/DotRecast.Recast.Toolset/Tools/RcTestNavmeshToolMode.cs | 2 +- src/DotRecast.Recast.Toolset/Tools/RcTileTool.cs | 1 + src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs | 1 + src/DotRecast.Recast/RcAreas.cs | 1 + 27 files changed, 29 insertions(+), 19 deletions(-) rename src/DotRecast.Core/{ => Collections}/CollectionExtensions.cs (97%) rename src/DotRecast.Core/{ => Collections}/RcImmutableArray.Enumerable.cs (98%) rename src/DotRecast.Core/{ => Collections}/RcImmutableArray.Listable.cs (97%) rename src/DotRecast.Core/{ => Collections}/RcImmutableArray.Minimal.cs (91%) rename src/DotRecast.Core/{ => Collections}/RcImmutableArray.cs (97%) rename src/DotRecast.Core/{ => Collections}/RcSortedQueue.cs (98%) diff --git a/src/DotRecast.Core/CollectionExtensions.cs b/src/DotRecast.Core/Collections/CollectionExtensions.cs similarity index 97% rename from src/DotRecast.Core/CollectionExtensions.cs rename to src/DotRecast.Core/Collections/CollectionExtensions.cs index 4a7dbc2..24d01fc 100644 --- a/src/DotRecast.Core/CollectionExtensions.cs +++ b/src/DotRecast.Core/Collections/CollectionExtensions.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public static class CollectionExtensions { @@ -20,12 +20,12 @@ namespace DotRecast.Core // Shift over values data[insertionIndex + 1] = data[insertionIndex]; } - + // Insert the value in sorted order. data[insertionIndex + 1] = value; } } - + public static void ForEach(this IEnumerable collection, Action action) { foreach (var item in collection) diff --git a/src/DotRecast.Core/RcImmutableArray.Enumerable.cs b/src/DotRecast.Core/Collections/RcImmutableArray.Enumerable.cs similarity index 98% rename from src/DotRecast.Core/RcImmutableArray.Enumerable.cs rename to src/DotRecast.Core/Collections/RcImmutableArray.Enumerable.cs index f08b4e6..c9ba186 100644 --- a/src/DotRecast.Core/RcImmutableArray.Enumerable.cs +++ b/src/DotRecast.Core/Collections/RcImmutableArray.Enumerable.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public readonly partial struct RcImmutableArray { diff --git a/src/DotRecast.Core/RcImmutableArray.Listable.cs b/src/DotRecast.Core/Collections/RcImmutableArray.Listable.cs similarity index 97% rename from src/DotRecast.Core/RcImmutableArray.Listable.cs rename to src/DotRecast.Core/Collections/RcImmutableArray.Listable.cs index b485193..fea1a2f 100644 --- a/src/DotRecast.Core/RcImmutableArray.Listable.cs +++ b/src/DotRecast.Core/Collections/RcImmutableArray.Listable.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public readonly partial struct RcImmutableArray : IList { diff --git a/src/DotRecast.Core/RcImmutableArray.Minimal.cs b/src/DotRecast.Core/Collections/RcImmutableArray.Minimal.cs similarity index 91% rename from src/DotRecast.Core/RcImmutableArray.Minimal.cs rename to src/DotRecast.Core/Collections/RcImmutableArray.Minimal.cs index 4306936..335f6c1 100644 --- a/src/DotRecast.Core/RcImmutableArray.Minimal.cs +++ b/src/DotRecast.Core/Collections/RcImmutableArray.Minimal.cs @@ -1,4 +1,4 @@ -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public readonly partial struct RcImmutableArray { diff --git a/src/DotRecast.Core/RcImmutableArray.cs b/src/DotRecast.Core/Collections/RcImmutableArray.cs similarity index 97% rename from src/DotRecast.Core/RcImmutableArray.cs rename to src/DotRecast.Core/Collections/RcImmutableArray.cs index f6c1bc6..190f5b9 100644 --- a/src/DotRecast.Core/RcImmutableArray.cs +++ b/src/DotRecast.Core/Collections/RcImmutableArray.cs @@ -1,6 +1,6 @@ using System; -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public static class RcImmutableArray { diff --git a/src/DotRecast.Core/RcSortedQueue.cs b/src/DotRecast.Core/Collections/RcSortedQueue.cs similarity index 98% rename from src/DotRecast.Core/RcSortedQueue.cs rename to src/DotRecast.Core/Collections/RcSortedQueue.cs index e8918c1..d6c2efe 100644 --- a/src/DotRecast.Core/RcSortedQueue.cs +++ b/src/DotRecast.Core/Collections/RcSortedQueue.cs @@ -21,7 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; -namespace DotRecast.Core +namespace DotRecast.Core.Collections { public class RcSortedQueue { diff --git a/src/DotRecast.Detour.Crowd/DtCrowd.cs b/src/DotRecast.Detour.Crowd/DtCrowd.cs index 47bcf71..8a801f8 100644 --- a/src/DotRecast.Detour.Crowd/DtCrowd.cs +++ b/src/DotRecast.Detour.Crowd/DtCrowd.cs @@ -21,6 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; diff --git a/src/DotRecast.Detour.Dynamic/DtDynamicTile.cs b/src/DotRecast.Detour.Dynamic/DtDynamicTile.cs index c5827a7..878efed 100644 --- a/src/DotRecast.Detour.Dynamic/DtDynamicTile.cs +++ b/src/DotRecast.Detour.Dynamic/DtDynamicTile.cs @@ -22,6 +22,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Detour.Dynamic.Colliders; using DotRecast.Detour.Dynamic.Io; using DotRecast.Recast; diff --git a/src/DotRecast.Detour/DtNavMeshQuery.cs b/src/DotRecast.Detour/DtNavMeshQuery.cs index 6b2199b..152a44e 100644 --- a/src/DotRecast.Detour/DtNavMeshQuery.cs +++ b/src/DotRecast.Detour/DtNavMeshQuery.cs @@ -21,6 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; namespace DotRecast.Detour diff --git a/src/DotRecast.Detour/DtNodeQueue.cs b/src/DotRecast.Detour/DtNodeQueue.cs index 5e8368f..bafe465 100644 --- a/src/DotRecast.Detour/DtNodeQueue.cs +++ b/src/DotRecast.Detour/DtNodeQueue.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Detour { diff --git a/src/DotRecast.Detour/DtStraightPathOption.cs b/src/DotRecast.Detour/DtStraightPathOption.cs index 4e3fe8e..9696c0d 100644 --- a/src/DotRecast.Detour/DtStraightPathOption.cs +++ b/src/DotRecast.Detour/DtStraightPathOption.cs @@ -1,4 +1,5 @@ using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Detour { diff --git a/src/DotRecast.Recast.Demo/Draw/DrawMode.cs b/src/DotRecast.Recast.Demo/Draw/DrawMode.cs index d5feda8..2ae378b 100644 --- a/src/DotRecast.Recast.Demo/Draw/DrawMode.cs +++ b/src/DotRecast.Recast.Demo/Draw/DrawMode.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Recast.Demo.Draw; diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs index 1c87bd2..9121213 100644 --- a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs @@ -22,6 +22,7 @@ using System; using System.IO; using System.Threading.Tasks; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Detour.Dynamic; using DotRecast.Recast.Toolset; diff --git a/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs b/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs index 5e5b5ce..7048f5e 100644 --- a/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs +++ b/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs @@ -1,5 +1,5 @@ using System; -using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Recast.Demo.Draw; using DotRecast.Recast.Toolset.Gizmos; diff --git a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs index b9d6088..303c0e7 100644 --- a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs @@ -19,8 +19,7 @@ freely, subject to the following restrictions: using System; using System.IO; using System.Numerics; -using DotRecast.Core; -using DotRecast.Core.Numerics; +using DotRecast.Core.Collections; using DotRecast.Recast.Demo.Draw; using DotRecast.Recast.Demo.Messages; using ImGuiNET; diff --git a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs index 2c019f0..97f165b 100644 --- a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs @@ -19,7 +19,7 @@ freely, subject to the following restrictions: */ using System.Numerics; -using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Recast.Demo.Tools; using ImGuiNET; diff --git a/src/DotRecast.Recast.Toolset/Builder/SampleAreaModifications.cs b/src/DotRecast.Recast.Toolset/Builder/SampleAreaModifications.cs index b754ee1..510f3b5 100644 --- a/src/DotRecast.Recast.Toolset/Builder/SampleAreaModifications.cs +++ b/src/DotRecast.Recast.Toolset/Builder/SampleAreaModifications.cs @@ -19,7 +19,7 @@ freely, subject to the following restrictions: */ using System.Linq; -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Recast.Toolset.Builder { diff --git a/src/DotRecast.Recast.Toolset/Builder/SoloNavMeshBuilder.cs b/src/DotRecast.Recast.Toolset/Builder/SoloNavMeshBuilder.cs index 35f5428..ab145f6 100644 --- a/src/DotRecast.Recast.Toolset/Builder/SoloNavMeshBuilder.cs +++ b/src/DotRecast.Recast.Toolset/Builder/SoloNavMeshBuilder.cs @@ -16,7 +16,7 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ -using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Detour; using DotRecast.Recast.Toolset.Geom; diff --git a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs index 7d16ac8..85ee692 100644 --- a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs +++ b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs @@ -21,6 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Recast.Geom; diff --git a/src/DotRecast.Recast.Toolset/Tools/RcCrowdAgentProfilingTool.cs b/src/DotRecast.Recast.Toolset/Tools/RcCrowdAgentProfilingTool.cs index f6336e0..87f3a50 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcCrowdAgentProfilingTool.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcCrowdAgentProfilingTool.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Detour; using DotRecast.Detour.Crowd; diff --git a/src/DotRecast.Recast.Toolset/Tools/RcCrowdToolMode.cs b/src/DotRecast.Recast.Toolset/Tools/RcCrowdToolMode.cs index 25d4164..69a5328 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcCrowdToolMode.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcCrowdToolMode.cs @@ -1,4 +1,4 @@ -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Recast.Toolset.Tools { diff --git a/src/DotRecast.Recast.Toolset/Tools/RcDynamicUpdateToolMode.cs b/src/DotRecast.Recast.Toolset/Tools/RcDynamicUpdateToolMode.cs index 3e2ee02..9a12183 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcDynamicUpdateToolMode.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcDynamicUpdateToolMode.cs @@ -1,4 +1,4 @@ -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Recast.Toolset.Tools { diff --git a/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs b/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs index 8d5b1b2..fcef37b 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Detour; using DotRecast.Detour.TileCache; diff --git a/src/DotRecast.Recast.Toolset/Tools/RcTestNavmeshToolMode.cs b/src/DotRecast.Recast.Toolset/Tools/RcTestNavmeshToolMode.cs index 188b6e3..2c60a4e 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcTestNavmeshToolMode.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcTestNavmeshToolMode.cs @@ -1,4 +1,4 @@ -using DotRecast.Core; +using DotRecast.Core.Collections; namespace DotRecast.Recast.Toolset.Tools { diff --git a/src/DotRecast.Recast.Toolset/Tools/RcTileTool.cs b/src/DotRecast.Recast.Toolset/Tools/RcTileTool.cs index b4119d5..a894827 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcTileTool.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcTileTool.cs @@ -1,5 +1,6 @@ using System.Linq; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; using DotRecast.Detour; using DotRecast.Recast.Geom; diff --git a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs index 8fe01e3..1567f9a 100644 --- a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs @@ -21,6 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; namespace DotRecast.Recast.Geom diff --git a/src/DotRecast.Recast/RcAreas.cs b/src/DotRecast.Recast/RcAreas.cs index cc8ed0a..7157554 100644 --- a/src/DotRecast.Recast/RcAreas.cs +++ b/src/DotRecast.Recast/RcAreas.cs @@ -20,6 +20,7 @@ freely, subject to the following restrictions: using System; using DotRecast.Core; +using DotRecast.Core.Collections; using DotRecast.Core.Numerics; namespace DotRecast.Recast