#include "rtti.h"

RuntimeClass::RuntimeClass(const char* classname) : m_classname(classname), m_baseRuntimeClass(nullptr)
{
}

RuntimeClass::RuntimeClass(const char* classname, const RuntimeClass* baseTypeInfo) : m_classname(classname), m_baseRuntimeClass(baseTypeInfo)
{
}

bool RuntimeClass::IsKindOf(const RuntimeClass* typeInfo) const
{
	for (const RuntimeClass* it = this; it != nullptr; it = it->m_baseRuntimeClass)
		if (it == typeInfo)
			return true;

	return false;
}

const char* RuntimeClass::Name() const
{
	return m_classname;
}
