Add ScriptingTypeHandle::IsAssignableFrom
This commit is contained in:
@@ -49,6 +49,17 @@ const ScriptingType& ScriptingTypeHandle::GetType() const
|
||||
return Module->Types[TypeIndex];
|
||||
}
|
||||
|
||||
bool ScriptingTypeHandle::IsAssignableFrom(ScriptingTypeHandle c) const
|
||||
{
|
||||
while (c)
|
||||
{
|
||||
if (c == *this)
|
||||
return true;
|
||||
c = c.GetType().GetBaseType();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptingTypeHandle::operator==(const ScriptingTypeInitializer& other) const
|
||||
{
|
||||
return Module == other.Module && TypeIndex == other.TypeIndex;
|
||||
|
||||
@@ -68,6 +68,7 @@ struct FLAXENGINE_API ScriptingTypeHandle
|
||||
String ToString(bool withAssembly = false) const;
|
||||
|
||||
const ScriptingType& GetType() const;
|
||||
bool IsAssignableFrom(ScriptingTypeHandle c) const;
|
||||
|
||||
bool operator==(const ScriptingTypeHandle& other) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user