enderalse/SKSE/Plugins/fs_skse_plugin_functions/common/IDynamicCreate.cpp
2021-10-06 02:45:46 +02:00

39 lines
747 B
C++

#include "IDynamicCreate.h"
#if ENABLE_IDYNAMICCREATE
IClassRegistry _gClassRegistry;
IClassRegistry::IClassRegistry()
{
//
}
IClassRegistry::~IClassRegistry()
{
//
}
void IClassRegistry::RegisterClassInfo(UInt32 id, IDynamicType * typeInfo)
{
theClassRegistry[id] = typeInfo;
}
IDynamicType * IClassRegistry::LookupClassInfo(UInt32 id)
{
ClassRegistryType::iterator iter = theClassRegistry.find(id);
return (iter == theClassRegistry.end()) ? NULL : (*iter).second;
}
IDynamicType * IClassRegistry::LookupClassInfo(char * name)
{
for(ClassRegistryType::iterator iter = theClassRegistry.begin(); iter != theClassRegistry.end(); iter++)
if(!strcmp((*iter).second->GetName(), name))
return (*iter).second;
return NULL;
}
#endif