2018-10-25 00:19:38 +00:00
|
|
|
#ifndef DUST3D_RIG_TYPE_H
|
|
|
|
#define DUST3D_RIG_TYPE_H
|
2018-09-14 09:45:05 +00:00
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
enum class RigType
|
|
|
|
{
|
|
|
|
None = 0,
|
2018-11-06 16:26:19 +00:00
|
|
|
Animal,
|
2018-09-14 09:45:05 +00:00
|
|
|
Count
|
|
|
|
};
|
|
|
|
RigType RigTypeFromString(const char *typeString);
|
|
|
|
#define IMPL_RigTypeFromString \
|
|
|
|
RigType RigTypeFromString(const char *typeString) \
|
|
|
|
{ \
|
|
|
|
QString type = typeString; \
|
2018-11-06 16:26:19 +00:00
|
|
|
if (type == "Animal") \
|
|
|
|
return RigType::Animal; \
|
2018-09-14 09:45:05 +00:00
|
|
|
return RigType::None; \
|
|
|
|
}
|
|
|
|
const char *RigTypeToString(RigType type);
|
|
|
|
#define IMPL_RigTypeToString \
|
|
|
|
const char *RigTypeToString(RigType type) \
|
|
|
|
{ \
|
|
|
|
switch (type) { \
|
2018-11-06 16:26:19 +00:00
|
|
|
case RigType::Animal: \
|
|
|
|
return "Animal"; \
|
2018-09-14 09:45:05 +00:00
|
|
|
case RigType::None: \
|
|
|
|
return "None"; \
|
|
|
|
default: \
|
|
|
|
return "None"; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
QString RigTypeToDispName(RigType type);
|
|
|
|
#define IMPL_RigTypeToDispName \
|
|
|
|
QString RigTypeToDispName(RigType type) \
|
|
|
|
{ \
|
|
|
|
switch (type) { \
|
2018-11-06 16:26:19 +00:00
|
|
|
case RigType::Animal: \
|
|
|
|
return QObject::tr("Animal"); \
|
2018-09-14 09:45:05 +00:00
|
|
|
case RigType::None: \
|
|
|
|
return QObject::tr("None"); \
|
|
|
|
default: \
|
|
|
|
return ""; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|