48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
//================= Copyright kotofyt, All rights reserved ==================//
|
|
//
|
|
// Purpose:
|
|
//
|
|
//===========================================================================//
|
|
|
|
#ifndef ENTITIES_H
|
|
#define ENTITIES_H
|
|
|
|
#include "stdint.h"
|
|
#include "networkbase.h"
|
|
|
|
class IEntityFactory;
|
|
class C_BaseEntity;
|
|
|
|
#define MAX_EDICTS 8192
|
|
|
|
class CEntitySystem
|
|
{
|
|
public:
|
|
CEntitySystem();
|
|
|
|
virtual void RegisterEntityClass( IEntityFactory *pEntityFactory, const char *szClassName );
|
|
virtual C_BaseEntity *CreateByClassname( const char *szName );
|
|
virtual C_BaseEntity *CreateByClassnameWithIndex( const char *szName, uint32_t uIndex );
|
|
|
|
virtual IEntityFactory *GetFactoryByClassname( const char *szName );
|
|
|
|
virtual void DestroyEntityByIndex( uint32_t uIndex );
|
|
virtual void DestroyEntityByPtr( C_BaseEntity *pEntity );
|
|
|
|
virtual void Think();
|
|
|
|
virtual void NetRecvPacket( NetPacket_t *pPacket );
|
|
virtual void NetSendThink( INetworkBase *pBase );
|
|
|
|
virtual C_BaseEntity **GetEntities();
|
|
private:
|
|
C_BaseEntity *m_pEntities[MAX_EDICTS];
|
|
int m_nEntityCount;
|
|
};
|
|
|
|
CEntitySystem *EntitySystem();
|
|
|
|
C_BaseEntity *UTIL_GetLocalPlayer();
|
|
|
|
#endif
|