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.

73 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //=======================================================================================//
  3. #if defined( REPLAY_ENABLED )
  4. #ifndef TF_REPLAY_H
  5. #define TF_REPLAY_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/genericclassbased_replay.h"
  11. //----------------------------------------------------------------------------------------
  12. class CTFReplay : public CGenericClassBasedReplay
  13. {
  14. typedef CGenericClassBasedReplay BaseClass;
  15. public:
  16. CTFReplay();
  17. ~CTFReplay();
  18. virtual void OnBeginRecording();
  19. virtual void OnEndRecording();
  20. virtual void OnComplete();
  21. virtual void FireGameEvent( IGameEvent *pEvent );
  22. virtual bool Read( KeyValues *pIn );
  23. virtual void Write( KeyValues *pOut );
  24. virtual void DumpGameSpecificData() const;
  25. virtual const char *GetPlayerClass() const { return g_aPlayerClassNames_NonLocalized[ m_nPlayerClass ]; }
  26. virtual const char *GetPlayerTeam() const { return m_nPlayerTeam == TF_TEAM_RED ? "red" : "blu"; }
  27. virtual const char *GetMaterialFriendlyPlayerClass() const;
  28. private:
  29. virtual void Update();
  30. void MedicUpdate();
  31. float GetSentryKillScreenshotDelay();
  32. virtual bool IsValidClass( int nClass ) const;
  33. virtual bool IsValidTeam( int iTeam ) const;
  34. virtual bool GetCurrentStats( RoundStats_t &out );
  35. virtual const char *GetStatString( int iStat ) const;
  36. virtual const char *GetPlayerClass( int iClass ) const;
  37. float m_flNextMedicUpdateTime;
  38. };
  39. //----------------------------------------------------------------------------------------
  40. inline CTFReplay *ToTFReplay( CReplay *pClientReplay )
  41. {
  42. return static_cast< CTFReplay * >( pClientReplay );
  43. }
  44. inline const CTFReplay *ToTFReplay( const CReplay *pClientReplay )
  45. {
  46. return static_cast< const CTFReplay * >( pClientReplay );
  47. }
  48. inline CTFReplay *GetTFReplay( ReplayHandle_t hReplay )
  49. {
  50. return ToTFReplay( g_pClientReplayContext->GetReplay( hReplay ) );
  51. }
  52. //----------------------------------------------------------------------------------------
  53. #endif // TF_REPLAY_H
  54. #endif