diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/tf_replay.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf/tf_replay.h')
| -rw-r--r-- | game/client/tf/tf_replay.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/game/client/tf/tf_replay.h b/game/client/tf/tf_replay.h new file mode 100644 index 0000000..238b700 --- /dev/null +++ b/game/client/tf/tf_replay.h @@ -0,0 +1,74 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +//=======================================================================================// + +#if defined( REPLAY_ENABLED ) + +#ifndef TF_REPLAY_H +#define TF_REPLAY_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +#include "replay/genericclassbased_replay.h" + +//---------------------------------------------------------------------------------------- + +class CTFReplay : public CGenericClassBasedReplay +{ + typedef CGenericClassBasedReplay BaseClass; +public: + CTFReplay(); + ~CTFReplay(); + + virtual void OnBeginRecording(); + virtual void OnEndRecording(); + virtual void OnComplete(); + virtual void FireGameEvent( IGameEvent *pEvent ); + + virtual bool Read( KeyValues *pIn ); + virtual void Write( KeyValues *pOut ); + + virtual void DumpGameSpecificData() const; + + virtual const char *GetPlayerClass() const { return g_aPlayerClassNames_NonLocalized[ m_nPlayerClass ]; } + virtual const char *GetPlayerTeam() const { return m_nPlayerTeam == TF_TEAM_RED ? "red" : "blu"; } + virtual const char *GetMaterialFriendlyPlayerClass() const; + +private: + virtual void Update(); + void MedicUpdate(); + float GetSentryKillScreenshotDelay(); + + virtual bool IsValidClass( int nClass ) const; + virtual bool IsValidTeam( int iTeam ) const; + virtual bool GetCurrentStats( RoundStats_t &out ); + virtual const char *GetStatString( int iStat ) const; + virtual const char *GetPlayerClass( int iClass ) const; + + float m_flNextMedicUpdateTime; +}; + +//---------------------------------------------------------------------------------------- + +inline CTFReplay *ToTFReplay( CReplay *pClientReplay ) +{ + return static_cast< CTFReplay * >( pClientReplay ); +} + +inline const CTFReplay *ToTFReplay( const CReplay *pClientReplay ) +{ + return static_cast< const CTFReplay * >( pClientReplay ); +} + +inline CTFReplay *GetTFReplay( ReplayHandle_t hReplay ) +{ + return ToTFReplay( g_pClientReplayContext->GetReplay( hReplay ) ); +} + +//---------------------------------------------------------------------------------------- + +#endif // TF_REPLAY_H + +#endif
\ No newline at end of file |