mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-08-16 08:09:53 +00:00
Convert enum to enum class
This commit is contained in:
@@ -20,14 +20,15 @@
|
||||
|
||||
#include "DetourNavMesh.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class TestCase
|
||||
{
|
||||
enum TestType
|
||||
enum class TestType : uint8_t
|
||||
{
|
||||
TEST_PATHFIND,
|
||||
TEST_RAYCAST
|
||||
PATHFIND,
|
||||
RAYCAST
|
||||
};
|
||||
|
||||
struct Test
|
||||
@@ -43,7 +44,7 @@ class TestCase
|
||||
delete[] polys;
|
||||
}
|
||||
|
||||
TestType type{};
|
||||
TestCase::TestType type{};
|
||||
float spos[3]{};
|
||||
float epos[3]{};
|
||||
float nspos[3]{};
|
||||
|
||||
@@ -164,7 +164,7 @@ bool TestCase::load(const std::string& filePath)
|
||||
{
|
||||
// Pathfind test.
|
||||
Test* test = new Test();
|
||||
test->type = TEST_PATHFIND;
|
||||
test->type = TestCase::TestType::PATHFIND;
|
||||
test->expand = false;
|
||||
test->next = tests;
|
||||
tests = test;
|
||||
@@ -184,7 +184,7 @@ bool TestCase::load(const std::string& filePath)
|
||||
{
|
||||
// Pathfind test.
|
||||
Test* test = new Test();
|
||||
test->type = TEST_RAYCAST;
|
||||
test->type = TestCase::TestType::RAYCAST;
|
||||
test->expand = false;
|
||||
test->next = tests;
|
||||
tests = test;
|
||||
@@ -258,7 +258,7 @@ void TestCase::doTests(dtNavMesh* navmesh, dtNavMeshQuery* navquery)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (iter->type == TEST_PATHFIND)
|
||||
if (iter->type == TestCase::TestType::PATHFIND)
|
||||
{
|
||||
// Find path
|
||||
TimeVal findPathStart = getPerfTime();
|
||||
@@ -299,7 +299,7 @@ void TestCase::doTests(dtNavMesh* navmesh, dtNavMeshQuery* navquery)
|
||||
memcpy(iter->straight, straight, sizeof(float) * 3 * iter->nstraight);
|
||||
}
|
||||
}
|
||||
else if (iter->type == TEST_RAYCAST)
|
||||
else if (iter->type == TestCase::TestType::RAYCAST)
|
||||
{
|
||||
float t = 0;
|
||||
float hitNormal[3], hitPos[3];
|
||||
|
||||
Reference in New Issue
Block a user