Added a static assert to make sure type IDs always have a corresponding type name.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-03-01 18:42:02 -04:00
parent 2f419c1c83
commit dcbe7c4871
+2
View File
@@ -202,6 +202,8 @@ StringMap<Type, TYPE_MAX_ENUM>::Entry typeEntries[] =
StringMap<Type, TYPE_MAX_ENUM> types(typeEntries, sizeof(typeEntries));
static_assert((sizeof(typeEntries) / sizeof(typeEntries[0])) == TYPE_MAX_ENUM, "Type name array size doesn't match the total number of type IDs!");
bool getType(const char *in, love::Type &out)
{
return types.find(in, out);