Team Fortress 2 Source Code as on 22/4/2020
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.

65 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( BASETEMPENTITY_H )
  14. #define BASETEMPENTITY_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include "edict.h"
  19. // This is the base class for TEMP ENTITIES that use the
  20. // event system to propagate
  21. class CBaseTempEntity
  22. {
  23. public:
  24. DECLARE_CLASS_NOBASE( CBaseTempEntity );
  25. DECLARE_SERVERCLASS();
  26. CBaseTempEntity( const char *name );
  27. virtual ~CBaseTempEntity( void );
  28. const char *GetName( void );
  29. // Force all derived classes to implement a test
  30. virtual void Test( const Vector& current_origin, const QAngle& current_angles );
  31. virtual void Create( IRecipientFilter& filter, float delay = 0.0 );
  32. virtual void Precache( void );
  33. CBaseTempEntity *GetNext( void );
  34. // Get list of tempentities
  35. static CBaseTempEntity *GetList( void );
  36. // Called at startup to allow temp entities to precache any models/sounds that they need
  37. static void PrecacheTempEnts( void );
  38. void NetworkStateChanged() {} // TE's are sent out right away so we don't track whether state changes or not,
  39. // but we want to allow CNetworkVars.
  40. void NetworkStateChanged( void *pVar ) {}
  41. private:
  42. // Descriptive name, for when running tests
  43. const char *m_pszName;
  44. // Next in chain
  45. CBaseTempEntity *m_pNext;
  46. // ConVars add themselves to this list for the executable. Then ConVarMgr::Init() runs through
  47. // all the console variables and registers them.
  48. static CBaseTempEntity *s_pTempEntities;
  49. };
  50. #endif // BASETEMPENTITY_H