30 lines
717 B
C++
30 lines
717 B
C++
#include "baseentity.h"
|
|
#include "cglm/mat4.h"
|
|
#include "tier0/platform.h"
|
|
|
|
CUtlSelfReferencingVector<CBaseEntity*> g_entities;
|
|
CUtlVector<CEntityRegistry*> g_RegisteredEntities;
|
|
|
|
CBaseEntity::CBaseEntity()
|
|
{
|
|
glm_mat4_identity(m_matrix);
|
|
};
|
|
|
|
CEntityRegistry::CEntityRegistry(const char *szName, const char *szClass, EntityRegistryFn pfn) :
|
|
m_szName(szName), m_szClass(szClass), m_pfn(pfn), m_pClientfn(0)
|
|
{
|
|
g_RegisteredEntities.AppendTail(this);
|
|
};
|
|
|
|
|
|
C_EntityRegistry::C_EntityRegistry( const char *szName, ClientEntityRegistryFn pfn )
|
|
{
|
|
for (auto &entity: g_RegisteredEntities)
|
|
{
|
|
if (!V_strcmp(entity->m_szClass, szName))
|
|
{
|
|
entity->m_pClientfn = pfn;
|
|
}
|
|
}
|
|
}
|