1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-07 09:43:40 +08:00
hl2sdk/public/entity2/entitycomponent.h
vanz696 ab21c70896
Add schemasystem (#215)
Update CUtlMemoryPool*, CUtlSymbol*, CUtlTSHash, CThreadSpinRWLock, CThreadFastMutex (now replaced by CThreadSpinMutex)

Implemented some missing ThreadInterlocked* functions
2024-03-18 15:46:20 +03:00

104 lines
2.4 KiB
C++

#ifndef ENTITYCOMPONENT_H
#define ENTITYCOMPONENT_H
#if _WIN32
#pragma once
#endif
#include "tier0/platform.h"
#include "tier1/utlsymbollarge.h"
#include "tier1/utlstring.h"
#include "datamap.h"
#include "schemasystem/schematypes.h"
class CEntityIdentity;
class CEntityComponentHelper;
struct ComponentUnserializerClassInfo_t;
struct EntOutput_t;
struct ComponentUnserializerKeyNamesChunk_t
{
CUtlStringToken m_keyNames[4];
};
struct ComponentUnserializerFieldInfo_t
{
CSchemaEnumInfo* m_pSchemaEnum;
const char* m_pKeyName;
uint16 m_nOffset;
uint16 m_nArraySize;
fieldtype_t m_Type;
bool m_bUnserializeAsMatrix : 1;
bool m_bArrayElement : 1;
bool m_bRemovedKeyField : 1;
};
struct ComponentUnserializerPtrToClassInfo_t
{
uint m_nOffset;
ComponentUnserializerClassInfo_t* m_pClassInfo;
};
struct ComponentUnserializerClassInfo_t
{
ComponentUnserializerClassInfo_t* m_pBaseClassInfo;
ComponentUnserializerKeyNamesChunk_t* m_pKeyNamesChunks;
ComponentUnserializerFieldInfo_t* m_pFieldInfos;
EntOutput_t* m_pOutputs;
ComponentUnserializerPtrToClassInfo_t* m_pClassInfoPtrs;
uint16 m_nFieldInfoCount;
uint16 m_nKeyNamesChunkCount;
uint16 m_nOutputCount;
uint16 m_nClassInfoPtrCount;
};
struct EntComponentInfo_t
{
const char* m_pName;
const char* m_pCPPClassname;
const char* m_pNetworkDataReferencedDescription;
const char* m_pNetworkDataReferencedPtrPropDescription;
int m_nRuntimeIndex;
uint m_nFlags;
ComponentUnserializerClassInfo_t m_componentUnserializerClassInfo;
void* m_pScriptDesc;
CEntityComponentHelper* m_pBaseClassComponentHelper;
};
class CEntityComponentHelper
{
public:
virtual SchemaMetaInfoHandle_t<CSchemaClassInfo> Schema_DynamicBinding() = 0;
virtual void Finalize() = 0;
virtual SchemaMetaInfoHandle_t<CSchemaClassInfo> GetSchemaBinding() = 0;
virtual datamap_t* GetDataDescMap() = 0;
virtual bool Allocate( CEntityIdentity* pEntity, void* pComponent ) = 0;
virtual void Free( CEntityIdentity* pEntity, void* pComponent ) = 0;
public:
uint m_flags;
EntComponentInfo_t* m_pInfo;
int m_nPriority;
CEntityComponentHelper* m_pNext;
};
class CEntityComponent
{
private:
uint8 unknown[0x8]; // 0x0
};
class CScriptComponent : public CEntityComponent
{
private:
uint8 unknown[0x28]; // 0x8
public:
CUtlSymbolLarge m_scriptClassName; // 0x30
};
#endif // ENTITYCOMPONENT_H