mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-12-08 02:58:24 +00:00
67 lines
1.5 KiB
C++
67 lines
1.5 KiB
C++
#ifndef ENTITYINSTANCE_H
|
|
#define ENTITYINSTANCE_H
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "tier1/utlsymbollarge.h"
|
|
#include "entitycomponent.h"
|
|
#include "entity2/entityidentity.h"
|
|
|
|
class CEntityInstance
|
|
{
|
|
virtual void Schema_DynamicBinding(void**) = 0;
|
|
|
|
public:
|
|
virtual ~CEntityInstance() = 0;
|
|
|
|
inline CEntityHandle GetRefEHandle() const
|
|
{
|
|
return m_pEntity->GetRefEHandle();
|
|
}
|
|
|
|
inline const char *GetClassname() const
|
|
{
|
|
return m_pEntity->GetClassname();
|
|
}
|
|
|
|
inline CEntityIndex GetEntityIndex() const
|
|
{
|
|
return m_pEntity->GetEntityIndex();
|
|
}
|
|
|
|
CUtlSymbolLarge m_iszPrivateVScripts; // 0x8
|
|
CEntityIdentity* m_pEntity; // 0x10
|
|
private:
|
|
void* m_hPrivateScope; // 0x18 - CEntityPrivateScriptScope
|
|
uint8 __pad001[0x8]; // 0x20
|
|
public:
|
|
CScriptComponent* m_CScriptComponent; // 0x28
|
|
};
|
|
|
|
// -------------------------------------------------------------------------------------------------- //
|
|
// CEntityInstance dependant functions
|
|
// -------------------------------------------------------------------------------------------------- //
|
|
|
|
inline bool CEntityHandle::operator <( const CEntityInstance *pEntity ) const
|
|
{
|
|
unsigned long otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX;
|
|
return m_Index < otherIndex;
|
|
}
|
|
|
|
inline const CEntityHandle &CEntityHandle::Set( const CEntityInstance *pEntity )
|
|
{
|
|
if(pEntity)
|
|
{
|
|
*this = pEntity->GetRefEHandle();
|
|
}
|
|
else
|
|
{
|
|
m_Index = INVALID_EHANDLE_INDEX;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
#endif // ENTITYINSTANCE_H
|