Log find path exception with level verbose, add more info to message

This commit is contained in:
elsid 2018-10-15 23:07:52 +03:00
parent dc2eb2e16b
commit 03d4ce5e49
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
5 changed files with 62 additions and 12 deletions

View file

@ -1,6 +1,8 @@
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_FLAGS_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_FLAGS_H
#include <ostream>
namespace DetourNavigator
{
using Flags = unsigned short;
@ -12,6 +14,49 @@ namespace DetourNavigator
Flag_swim = 1 << 1,
Flag_openDoor = 1 << 2,
};
inline std::ostream& operator <<(std::ostream& stream, const Flag value)
{
switch (value) {
case Flag_none:
return stream << "none";
case Flag_walk:
return stream << "walk";
case Flag_swim:
return stream << "swim";
case Flag_openDoor:
return stream << "openDoor";
}
}
struct WriteFlags
{
Flags mValue;
friend inline std::ostream& operator <<(std::ostream& stream, const WriteFlags& value)
{
if (value.mValue == Flag_none)
{
return stream << Flag_none;
}
else
{
bool first = true;
for (const auto flag : {Flag_walk, Flag_swim, Flag_openDoor})
{
if (value.mValue & flag)
{
if (!first)
stream << " | ";
first = false;
stream << flag;
}
}
return stream;
}
}
};
}
#endif