Refactor enum flags with __underlying_type and new EnumHasAnyFlags/EnumHasAllFlags
Fixes #832 Closes #886
This commit is contained in:
@@ -265,7 +265,7 @@ void Script::Initialize()
|
||||
{
|
||||
ASSERT(!IsDuringPlay());
|
||||
|
||||
if (Flags & ObjectFlags::IsManagedType || Flags & ObjectFlags::IsCustomScriptingType)
|
||||
if (EnumHasAnyFlags(Flags, ObjectFlags::IsManagedType | ObjectFlags::IsCustomScriptingType))
|
||||
SetupType();
|
||||
|
||||
// Use lazy creation for the managed instance, just register the object
|
||||
|
||||
@@ -45,7 +45,7 @@ ScriptingObject::~ScriptingObject()
|
||||
ASSERT(_gcHandle == 0);
|
||||
|
||||
// Handle custom scripting objects removing
|
||||
if (Flags & ObjectFlags::IsCustomScriptingType)
|
||||
if (EnumHasAnyFlags(Flags, ObjectFlags::IsCustomScriptingType))
|
||||
{
|
||||
_type.Module->OnObjectDeleted(this);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
/// </summary>
|
||||
FORCE_INLINE bool IsRegistered() const
|
||||
{
|
||||
return (Flags & ObjectFlags::IsRegistered) != 0;
|
||||
return (Flags & ObjectFlags::IsRegistered) != ObjectFlags::None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user