Created ComponentInfo::EnumType which defines which native type to use for enums.

This commit is contained in:
2016-01-19 12:33:53 +01:00
parent a6445c65aa
commit cfe023cc1d
5 changed files with 12 additions and 7 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ struct ComponentWrapper
const ::EntityID EntityID;
char* Data;
int Enum(const char* fieldName, const char* enumKey)
ComponentInfo::EnumType Enum(const char* fieldName, const char* enumKey)
{
return Info.Meta->FieldEnumDefinitions.at(fieldName).at(enumKey);
}
@@ -58,7 +58,7 @@ struct ComponentWrapper
public:
// Return the integer value of an enum type key for this field
int Enum(const char* enumKey) { return m_Component->Enum(m_PropertyName.c_str(), enumKey); }
ComponentInfo::EnumType Enum(const char* enumKey) { return m_Component->Enum(m_PropertyName.c_str(), enumKey); }
template <typename T>
operator T&() { return m_Component->Field<T>(m_PropertyName); }