Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #if !defined( ICLIENTENTITYLIST_H )
  10. #define ICLIENTENTITYLIST_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "interface.h"
  15. class IClientEntity;
  16. class ClientClass;
  17. class IClientNetworkable;
  18. class CBaseHandle;
  19. class IClientUnknown;
  20. // Cached info for networked entities.
  21. // NOTE: Changing this changes the interface between engine & client
  22. struct EntityCacheInfo_t
  23. {
  24. // Cached off because GetClientNetworkable is called a *lot*
  25. IClientNetworkable *m_pNetworkable;
  26. unsigned short m_BaseEntitiesIndex; // Index into m_BaseEntities (or m_BaseEntities.InvalidIndex() if none).
  27. unsigned short m_bDormant; // cached dormant state - this is only a bit
  28. };
  29. //-----------------------------------------------------------------------------
  30. // Purpose: Exposes IClientEntity's to engine
  31. //-----------------------------------------------------------------------------
  32. abstract_class IClientEntityList
  33. {
  34. public:
  35. // Get IClientNetworkable interface for specified entity
  36. virtual IClientNetworkable* GetClientNetworkable( int entnum ) = 0;
  37. virtual IClientNetworkable* GetClientNetworkableFromHandle( CBaseHandle hEnt ) = 0;
  38. virtual IClientUnknown* GetClientUnknownFromHandle( CBaseHandle hEnt ) = 0;
  39. // NOTE: This function is only a convenience wrapper.
  40. // It returns GetClientNetworkable( entnum )->GetIClientEntity().
  41. virtual IClientEntity* GetClientEntity( int entnum ) = 0;
  42. virtual IClientEntity* GetClientEntityFromHandle( CBaseHandle hEnt ) = 0;
  43. // Returns number of entities currently in use
  44. virtual int NumberOfEntities( bool bIncludeNonNetworkable ) = 0;
  45. // Returns highest index actually used
  46. virtual int GetHighestEntityIndex( void ) = 0;
  47. // Sizes entity list to specified size
  48. virtual void SetMaxEntities( int maxents ) = 0;
  49. virtual int GetMaxEntities( ) = 0;
  50. virtual EntityCacheInfo_t *GetClientNetworkableArray() = 0;
  51. };
  52. extern IClientEntityList *entitylist;
  53. #define VCLIENTENTITYLIST_INTERFACE_VERSION "VClientEntityList003"
  54. #endif // ICLIENTENTITYLIST_H