sqwarmed/sdk_src/public/icliententitylist.h

68 lines
2.3 KiB
C++

//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#if !defined( ICLIENTENTITYLIST_H )
#define ICLIENTENTITYLIST_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
class IClientEntity;
class ClientClass;
class IClientNetworkable;
class CBaseHandle;
class IClientUnknown;
// Cached info for networked entities.
// NOTE: Changing this changes the interface between engine & client
struct EntityCacheInfo_t
{
// Cached off because GetClientNetworkable is called a *lot*
IClientNetworkable *m_pNetworkable;
unsigned short m_BaseEntitiesIndex; // Index into m_BaseEntities (or m_BaseEntities.InvalidIndex() if none).
unsigned short m_bDormant; // cached dormant state - this is only a bit
};
//-----------------------------------------------------------------------------
// Purpose: Exposes IClientEntity's to engine
//-----------------------------------------------------------------------------
abstract_class IClientEntityList
{
public:
// Get IClientNetworkable interface for specified entity
virtual IClientNetworkable* GetClientNetworkable( int entnum ) = 0;
virtual IClientNetworkable* GetClientNetworkableFromHandle( CBaseHandle hEnt ) = 0;
virtual IClientUnknown* GetClientUnknownFromHandle( CBaseHandle hEnt ) = 0;
// NOTE: This function is only a convenience wrapper.
// It returns GetClientNetworkable( entnum )->GetIClientEntity().
virtual IClientEntity* GetClientEntity( int entnum ) = 0;
virtual IClientEntity* GetClientEntityFromHandle( CBaseHandle hEnt ) = 0;
// Returns number of entities currently in use
virtual int NumberOfEntities( bool bIncludeNonNetworkable ) = 0;
// Returns highest index actually used
virtual int GetHighestEntityIndex( void ) = 0;
// Sizes entity list to specified size
virtual void SetMaxEntities( int maxents ) = 0;
virtual int GetMaxEntities( ) = 0;
virtual EntityCacheInfo_t *GetClientNetworkableArray() = 0;
};
extern IClientEntityList *entitylist;
#define VCLIENTENTITYLIST_INTERFACE_VERSION "VClientEntityList003"
#endif // ICLIENTENTITYLIST_H