diff --git a/src/DotRecast.Detour.Crowd/CrowdAgent.cs b/src/DotRecast.Detour.Crowd/CrowdAgent.cs index 8635926..8badb02 100644 --- a/src/DotRecast.Detour.Crowd/CrowdAgent.cs +++ b/src/DotRecast.Detour.Crowd/CrowdAgent.cs @@ -26,30 +26,6 @@ namespace DotRecast.Detour.Crowd { using static DotRecast.Core.RecastMath; - /// The type of navigation mesh polygon the agent is currently traversing. - /// @ingroup crowd - public enum CrowdAgentState - { - DT_CROWDAGENT_STATE_INVALID, - - /// < The agent is not in a valid state. - DT_CROWDAGENT_STATE_WALKING, - - /// < The agent is traversing a normal navigation mesh polygon. - DT_CROWDAGENT_STATE_OFFMESH, /// < The agent is traversing an off-mesh connection. - }; - - public enum MoveRequestState - { - DT_CROWDAGENT_TARGET_NONE, - DT_CROWDAGENT_TARGET_FAILED, - DT_CROWDAGENT_TARGET_VALID, - DT_CROWDAGENT_TARGET_REQUESTING, - DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE, - DT_CROWDAGENT_TARGET_WAITING_FOR_PATH, - DT_CROWDAGENT_TARGET_VELOCITY, - }; - /// Represents an agent managed by a #dtCrowd object. /// @ingroup crowd public class CrowdAgent @@ -241,4 +217,4 @@ namespace DotRecast.Detour.Crowd } } } -} +} \ No newline at end of file diff --git a/src/DotRecast.Detour.Crowd/CrowdAgentState.cs b/src/DotRecast.Detour.Crowd/CrowdAgentState.cs new file mode 100644 index 0000000..06c24f6 --- /dev/null +++ b/src/DotRecast.Detour.Crowd/CrowdAgentState.cs @@ -0,0 +1,15 @@ +namespace DotRecast.Detour.Crowd +{ + /// The type of navigation mesh polygon the agent is currently traversing. + /// @ingroup crowd + public enum CrowdAgentState + { + DT_CROWDAGENT_STATE_INVALID, + + /// < The agent is not in a valid state. + DT_CROWDAGENT_STATE_WALKING, + + /// < The agent is traversing a normal navigation mesh polygon. + DT_CROWDAGENT_STATE_OFFMESH, /// < The agent is traversing an off-mesh connection. + }; +} \ No newline at end of file diff --git a/src/DotRecast.Detour.Crowd/MoveRequestState.cs b/src/DotRecast.Detour.Crowd/MoveRequestState.cs new file mode 100644 index 0000000..b0d6830 --- /dev/null +++ b/src/DotRecast.Detour.Crowd/MoveRequestState.cs @@ -0,0 +1,13 @@ +namespace DotRecast.Detour.Crowd +{ + public enum MoveRequestState + { + DT_CROWDAGENT_TARGET_NONE, + DT_CROWDAGENT_TARGET_FAILED, + DT_CROWDAGENT_TARGET_VALID, + DT_CROWDAGENT_TARGET_REQUESTING, + DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE, + DT_CROWDAGENT_TARGET_WAITING_FOR_PATH, + DT_CROWDAGENT_TARGET_VELOCITY, + }; +} \ No newline at end of file diff --git a/src/DotRecast.Detour.Extras/PolyUtils.cs b/src/DotRecast.Detour.Extras/PolyUtils.cs index ec86a25..e5df3ed 100644 --- a/src/DotRecast.Detour.Extras/PolyUtils.cs +++ b/src/DotRecast.Detour.Extras/PolyUtils.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: namespace DotRecast.Detour.Extras { - public class PolyUtils + public static class PolyUtils { /** * Find edge shared by 2 polygons within the same tile diff --git a/src/DotRecast.Recast.Demo/Tools/ColliderShape.cs b/src/DotRecast.Recast.Demo/Tools/ColliderShape.cs new file mode 100644 index 0000000..426dd89 --- /dev/null +++ b/src/DotRecast.Recast.Demo/Tools/ColliderShape.cs @@ -0,0 +1,13 @@ +namespace DotRecast.Recast.Demo.Tools; + +public enum ColliderShape +{ + SPHERE, + CAPSULE, + BOX, + CYLINDER, + COMPOSITE, + CONVEX, + TRIMESH_BRIDGE, + TRIMESH_HOUSE +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/Tools/ConsoleTextWriterHook.cs b/src/DotRecast.Recast.Demo/Tools/ConsoleTextWriterHook.cs index d06bb6e..14563c8 100644 --- a/src/DotRecast.Recast.Demo/Tools/ConsoleTextWriterHook.cs +++ b/src/DotRecast.Recast.Demo/Tools/ConsoleTextWriterHook.cs @@ -16,7 +16,7 @@ public class ConsoleTextWriterHook : TextWriter public override void Write(char[] buffer, int index, int count) { - var s = new String(new Span(buffer, index, count)); + var s = new string(new Span(buffer, index, count)); _event?.Invoke(s); } } \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs index 03708e2..24325ed 100644 --- a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs @@ -44,38 +44,6 @@ using static DotRecast.Core.RecastMath; namespace DotRecast.Recast.Demo.Tools; -public class DynamicUpdateToolMode -{ - public static readonly DynamicUpdateToolMode BUILD = new(0, "Build"); - public static readonly DynamicUpdateToolMode COLLIDERS = new(1, "Colliders"); - public static readonly DynamicUpdateToolMode RAYCAST = new(2, "Raycast"); - - public static readonly ImmutableArray Values = ImmutableArray.Create( - BUILD, COLLIDERS, RAYCAST - ); - - public int Idx { get; } - public string Label { get; } - - private DynamicUpdateToolMode(int idx, string label) - { - Idx = idx; - Label = label; - } -} - -public enum ColliderShape -{ - SPHERE, - CAPSULE, - BOX, - CYLINDER, - COMPOSITE, - CONVEX, - TRIMESH_BRIDGE, - TRIMESH_HOUSE -} - public class DynamicUpdateTool : Tool { private Sample sample; @@ -247,7 +215,7 @@ public class DynamicUpdateTool : Tool private Tuple BoxCollider(Vector3f p) { Vector3f extent = Vector3f.Of( - 0.5f + (float)random.NextDouble() * 6f, + 0.5f + (float)random.NextDouble() * 6f, 0.5f + (float)random.NextDouble() * 6f, 0.5f + (float)random.NextDouble() * 6f ); @@ -787,4 +755,4 @@ public class DynamicUpdateTool : Tool { return "Dynamic Updates"; } -} +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateToolMode.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateToolMode.cs new file mode 100644 index 0000000..bae2853 --- /dev/null +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateToolMode.cs @@ -0,0 +1,23 @@ +using System.Collections.Immutable; + +namespace DotRecast.Recast.Demo.Tools; + +public class DynamicUpdateToolMode +{ + public static readonly DynamicUpdateToolMode BUILD = new(0, "Build"); + public static readonly DynamicUpdateToolMode COLLIDERS = new(1, "Colliders"); + public static readonly DynamicUpdateToolMode RAYCAST = new(2, "Raycast"); + + public static readonly ImmutableArray Values = ImmutableArray.Create( + BUILD, COLLIDERS, RAYCAST + ); + + public int Idx { get; } + public string Label { get; } + + private DynamicUpdateToolMode(int idx, string label) + { + Idx = idx; + Label = label; + } +} \ No newline at end of file