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.

95 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHOREOCHANNEL_H
  8. #define CHOREOCHANNEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tier1/utlvector.h"
  13. #include "tier1/utlrbtree.h"
  14. class CChoreoEvent;
  15. class CChoreoActor;
  16. class CChoreoScene;
  17. class CUtlBuffer;
  18. class IChoreoStringPool;
  19. //-----------------------------------------------------------------------------
  20. // Purpose: A channel is owned by an actor and contains zero or more events
  21. //-----------------------------------------------------------------------------
  22. class CChoreoChannel
  23. {
  24. public:
  25. // Construction
  26. CChoreoChannel( void );
  27. CChoreoChannel( const char *name );
  28. // Assignment
  29. CChoreoChannel& operator=(const CChoreoChannel& src );
  30. // Serialization
  31. void SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
  32. bool RestoreFromBuffer( CUtlBuffer& buf, CChoreoScene *pScene, CChoreoActor *pActor, IChoreoStringPool *pStringPool );
  33. // Accessors
  34. void SetName( const char *name );
  35. const char *GetName( void );
  36. // Iterate children
  37. int GetNumEvents( void );
  38. CChoreoEvent *GetEvent( int event );
  39. // Manipulate children
  40. void AddEvent( CChoreoEvent *event );
  41. void RemoveEvent( CChoreoEvent *event );
  42. int FindEventIndex( CChoreoEvent *event );
  43. void RemoveAllEvents();
  44. CChoreoActor *GetActor( void );
  45. void SetActor( CChoreoActor *actor );
  46. void SetActive( bool active );
  47. bool GetActive( void ) const;
  48. // Compute true start/end times for gesture events in this channel, factoring in "null" gestures as needed
  49. void ReconcileGestureTimes();
  50. // Compute master/slave, count, endtime info for close captioning data
  51. void ReconcileCloseCaption();
  52. bool IsMarkedForSave() const { return m_bMarkedForSave; }
  53. void SetMarkedForSave( bool mark ) { m_bMarkedForSave = mark; }
  54. void MarkForSaveAll( bool mark );
  55. bool GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& sorted );
  56. private:
  57. // Initialize fields
  58. void Init( void );
  59. enum
  60. {
  61. MAX_CHANNEL_NAME = 128,
  62. };
  63. CChoreoActor *m_pActor;
  64. // Channels are just named
  65. char m_szName[ MAX_CHANNEL_NAME ];
  66. // All of the events for this channel
  67. CUtlVector < CChoreoEvent * > m_Events;
  68. bool m_bActive;
  69. // Purely for save/load
  70. bool m_bMarkedForSave;
  71. };
  72. #endif // CHOREOCHANNEL_H