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.

89 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHOREOACTOR_H
  8. #define CHOREOACTOR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tier1/utlvector.h"
  13. class CChoreoChannel;
  14. class CChoreoScene;
  15. class CUtlBuffer;
  16. class IChoreoStringPool;
  17. //-----------------------------------------------------------------------------
  18. // Purpose: The actor is the atomic element of a scene
  19. // A scene can have one or more actors, who have multiple events on one or
  20. // more channels
  21. //-----------------------------------------------------------------------------
  22. class CChoreoActor
  23. {
  24. public:
  25. // Construction
  26. CChoreoActor( void );
  27. CChoreoActor( const char *name );
  28. // Assignment
  29. CChoreoActor& operator = ( const CChoreoActor& src );
  30. // Serialization
  31. void SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
  32. bool RestoreFromBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
  33. // Accessors
  34. void SetName( const char *name );
  35. const char *GetName( void );
  36. // Iteration
  37. int GetNumChannels( void );
  38. CChoreoChannel *GetChannel( int channel );
  39. CChoreoChannel *FindChannel( const char *name );
  40. // Manipulate children
  41. void AddChannel( CChoreoChannel *channel );
  42. void RemoveChannel( CChoreoChannel *channel );
  43. int FindChannelIndex( CChoreoChannel *channel );
  44. void SwapChannels( int c1, int c2 );
  45. void RemoveAllChannels();
  46. void SetFacePoserModelName( const char *name );
  47. char const *GetFacePoserModelName( void ) const;
  48. void SetActive( bool active );
  49. bool GetActive( void ) const;
  50. bool IsMarkedForSave() const { return m_bMarkedForSave; }
  51. void SetMarkedForSave( bool mark ) { m_bMarkedForSave = mark; }
  52. void MarkForSaveAll( bool mark );
  53. private:
  54. // Clear structure out
  55. void Init( void );
  56. enum
  57. {
  58. MAX_ACTOR_NAME = 128,
  59. MAX_FACEPOSER_MODEL_NAME = 128
  60. };
  61. char m_szName[ MAX_ACTOR_NAME ];
  62. char m_szFacePoserModelName[ MAX_FACEPOSER_MODEL_NAME ];
  63. // Children
  64. CUtlVector < CChoreoChannel * > m_Channels;
  65. bool m_bActive;
  66. // Purely for save/load
  67. bool m_bMarkedForSave;
  68. };
  69. #endif // CHOREOACTOR_H