move enum

This commit is contained in:
ikpil 2023-05-07 18:15:22 +09:00
parent 5c2a654de5
commit 208c1a9e76
8 changed files with 69 additions and 61 deletions

View File

@ -26,30 +26,6 @@ namespace DotRecast.Detour.Crowd
{ {
using static DotRecast.Core.RecastMath; 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. /// Represents an agent managed by a #dtCrowd object.
/// @ingroup crowd /// @ingroup crowd
public class CrowdAgent public class CrowdAgent
@ -241,4 +217,4 @@ namespace DotRecast.Detour.Crowd
} }
} }
} }
} }

View File

@ -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.
};
}

View File

@ -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,
};
}

View File

@ -18,7 +18,7 @@ freely, subject to the following restrictions:
namespace DotRecast.Detour.Extras namespace DotRecast.Detour.Extras
{ {
public class PolyUtils public static class PolyUtils
{ {
/** /**
* Find edge shared by 2 polygons within the same tile * Find edge shared by 2 polygons within the same tile

View File

@ -0,0 +1,13 @@
namespace DotRecast.Recast.Demo.Tools;
public enum ColliderShape
{
SPHERE,
CAPSULE,
BOX,
CYLINDER,
COMPOSITE,
CONVEX,
TRIMESH_BRIDGE,
TRIMESH_HOUSE
}

View File

@ -16,7 +16,7 @@ public class ConsoleTextWriterHook : TextWriter
public override void Write(char[] buffer, int index, int count) public override void Write(char[] buffer, int index, int count)
{ {
var s = new String(new Span<char>(buffer, index, count)); var s = new string(new Span<char>(buffer, index, count));
_event?.Invoke(s); _event?.Invoke(s);
} }
} }

View File

@ -44,38 +44,6 @@ using static DotRecast.Core.RecastMath;
namespace DotRecast.Recast.Demo.Tools; 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<DynamicUpdateToolMode> 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 public class DynamicUpdateTool : Tool
{ {
private Sample sample; private Sample sample;
@ -247,7 +215,7 @@ public class DynamicUpdateTool : Tool
private Tuple<ICollider, IColliderGizmo> BoxCollider(Vector3f p) private Tuple<ICollider, IColliderGizmo> BoxCollider(Vector3f p)
{ {
Vector3f extent = Vector3f.Of( 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,
0.5f + (float)random.NextDouble() * 6f 0.5f + (float)random.NextDouble() * 6f
); );
@ -787,4 +755,4 @@ public class DynamicUpdateTool : Tool
{ {
return "Dynamic Updates"; return "Dynamic Updates";
} }
} }

View File

@ -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<DynamicUpdateToolMode> Values = ImmutableArray.Create(
BUILD, COLLIDERS, RAYCAST
);
public int Idx { get; }
public string Label { get; }
private DynamicUpdateToolMode(int idx, string label)
{
Idx = idx;
Label = label;
}
}