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.

60 lines
1.3 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. //
  3. // work in progress
  4. //
  5. //===============================================================================
  6. #ifndef __GLOBAL_EVENT_LOG_H
  7. #define __GLOBAL_EVENT_LOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "igamesystem.h"
  12. class CGlobalEvent;
  13. class CGlobalEventLog : public CAutoGameSystemPerFrame
  14. {
  15. public:
  16. typedef enum
  17. {
  18. GLOBAL_EVENT_NPCS = 0,
  19. GLOBAL_EVENT_MAX
  20. } EGlobalEvent;
  21. public:
  22. CGlobalEventLog( );
  23. CGlobalEvent *GetGlobalEvent( EGlobalEvent GlobalEvent );
  24. CGlobalEvent *CreateEvent( const char *pszName, bool bIsHighLevel, CGlobalEvent *pParent = NULL );
  25. CGlobalEvent *CreateTempEvent( const char *pszName, CGlobalEvent *pParent = NULL );
  26. void RemoveEvent( CGlobalEvent *pEvent );
  27. void AddKeyValue( CGlobalEvent *pEvent, bool bVarying, const char *pszKey, const char *pszValueFormat, ... );
  28. void SendUpdate( );
  29. protected:
  30. virtual void PostInit( );
  31. virtual void FrameUpdatePostEntityThink( );
  32. private:
  33. unsigned int m_nNextID;
  34. CUtlVector< CGlobalEvent * > m_Events;
  35. CUtlVector< CGlobalEvent * > m_TempEvents;
  36. CUtlVector< CGlobalEvent * > m_DirtyEvents;
  37. CGlobalEvent *m_pGlobalEvents[ GLOBAL_EVENT_MAX ];
  38. };
  39. extern CGlobalEventLog GlobalEventLog;
  40. #endif // #ifndef __GLOBAL_EVENT_LOG_H