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.

86 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #include "replay/basereplayserializeable.h"
  5. #include "replay/replayutils.h"
  6. #include "KeyValues.h"
  7. #include "tier1/strtools.h"
  8. #include "replay/shared_defs.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //----------------------------------------------------------------------------------------
  12. CBaseReplaySerializeable::CBaseReplaySerializeable()
  13. : m_hThis( REPLAY_HANDLE_INVALID ),
  14. m_bLocked( false )
  15. {
  16. }
  17. void CBaseReplaySerializeable::SetHandle( ReplayHandle_t h )
  18. {
  19. m_hThis = h;
  20. }
  21. ReplayHandle_t CBaseReplaySerializeable::GetHandle() const
  22. {
  23. return m_hThis;
  24. }
  25. bool CBaseReplaySerializeable::Read( KeyValues *pIn )
  26. {
  27. m_hThis = (ReplayHandle_t)pIn->GetInt( "handle" );
  28. return true;
  29. }
  30. void CBaseReplaySerializeable::Write( KeyValues *pOut )
  31. {
  32. pOut->SetInt( "handle", (int)m_hThis );
  33. }
  34. const char *CBaseReplaySerializeable::GetFullFilename() const
  35. {
  36. const char *pPath = GetPath();
  37. const char *pFilename = GetFilename();
  38. if ( !pPath || !pPath[0] || !pFilename || !pFilename[0] )
  39. return NULL;
  40. return Replay_va( "%s%s", pPath, pFilename );
  41. }
  42. const char *CBaseReplaySerializeable::GetFilename() const
  43. {
  44. return Replay_va( "%s.%s", GetSubKeyTitle(), GENERIC_FILE_EXTENSION );
  45. }
  46. const char *CBaseReplaySerializeable::GetDebugName() const
  47. {
  48. return GetSubKeyTitle();
  49. }
  50. void CBaseReplaySerializeable::SetLocked( bool bLocked )
  51. {
  52. m_bLocked = bLocked;
  53. }
  54. bool CBaseReplaySerializeable::IsLocked() const
  55. {
  56. return m_bLocked;
  57. }
  58. void CBaseReplaySerializeable::OnDelete()
  59. {
  60. }
  61. void CBaseReplaySerializeable::OnUnload()
  62. {
  63. }
  64. void CBaseReplaySerializeable::OnAddedToDirtyList()
  65. {
  66. }
  67. //----------------------------------------------------------------------------------------