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.

51 lines
1.3 KiB

  1. //===== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef MM_EVENTS_H
  7. #define MM_EVENTS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mm_framework.h"
  12. #include "utlvector.h"
  13. class CMatchEventsSubscription : public IMatchEventsSubscription
  14. {
  15. // Methods of IMatchEventsSubscription
  16. public:
  17. virtual void Subscribe( IMatchEventsSink *pSink );
  18. virtual void Unsubscribe( IMatchEventsSink *pSink );
  19. virtual void BroadcastEvent( KeyValues *pEvent );
  20. virtual void RegisterEventData( KeyValues *pEventData );
  21. virtual KeyValues * GetEventData( char const *szEventDataKey );
  22. public:
  23. bool IsBroacasting() const { return m_bBroadcasting; }
  24. void Shutdown();
  25. public:
  26. CMatchEventsSubscription();
  27. ~CMatchEventsSubscription();
  28. protected:
  29. CUtlVector< IMatchEventsSink * > m_arrSinks;
  30. CUtlVector< int > m_arrRefCount;
  31. CUtlVector< int > m_arrIteratorsOutstanding;
  32. bool m_bBroadcasting;
  33. bool m_bAllowNestedBroadcasts;
  34. CUtlVector< KeyValues * > m_arrQueuedEvents;
  35. CUtlVector< KeyValues * > m_arrEventData;
  36. CUtlVector< KeyValues * > m_arrSentEvents;
  37. };
  38. // Match events subscription singleton
  39. extern CMatchEventsSubscription *g_pMatchEventsSubscription;
  40. #endif // MM_EVENTS_H