1 #ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_STATUS_H 2 #define OPENMW_COMPONENTS_DETOURNAVIGATOR_STATUS_H 3 4 namespace DetourNavigator 5 { 6 enum class Status 7 { 8 Success, 9 NavMeshNotFound, 10 StartPolygonNotFound, 11 EndPolygonNotFound, 12 MoveAlongSurfaceFailed, 13 FindPathOverPolygonsFailed, 14 GetPolyHeightFailed, 15 InitNavMeshQueryFailed, 16 }; 17 getMessage(Status value)18 constexpr const char* getMessage(Status value) 19 { 20 switch (value) 21 { 22 case Status::Success: 23 return "success"; 24 case Status::NavMeshNotFound: 25 return "navmesh is not found"; 26 case Status::StartPolygonNotFound: 27 return "polygon for start position is not found on navmesh"; 28 case Status::EndPolygonNotFound: 29 return "polygon for end position is not found on navmesh"; 30 case Status::MoveAlongSurfaceFailed: 31 return "move along surface on navmesh is failed"; 32 case Status::FindPathOverPolygonsFailed: 33 return "path over navmesh polygons is not found"; 34 case Status::GetPolyHeightFailed: 35 return "failed to get polygon height"; 36 case Status::InitNavMeshQueryFailed: 37 return "failed to init navmesh query"; 38 } 39 return "unknown error"; 40 } 41 } 42 43 #endif 44