summaryrefslogtreecommitdiff
path: root/replay/common/basereplayserializeable.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /replay/common/basereplayserializeable.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'replay/common/basereplayserializeable.cpp')
-rw-r--r--replay/common/basereplayserializeable.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/replay/common/basereplayserializeable.cpp b/replay/common/basereplayserializeable.cpp
new file mode 100644
index 0000000..a0a7bd4
--- /dev/null
+++ b/replay/common/basereplayserializeable.cpp
@@ -0,0 +1,87 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#include "replay/basereplayserializeable.h"
+#include "replay/replayutils.h"
+#include "KeyValues.h"
+#include "tier1/strtools.h"
+#include "replay/shared_defs.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+//----------------------------------------------------------------------------------------
+
+CBaseReplaySerializeable::CBaseReplaySerializeable()
+: m_hThis( REPLAY_HANDLE_INVALID ),
+ m_bLocked( false )
+{
+}
+
+void CBaseReplaySerializeable::SetHandle( ReplayHandle_t h )
+{
+ m_hThis = h;
+}
+
+ReplayHandle_t CBaseReplaySerializeable::GetHandle() const
+{
+ return m_hThis;
+}
+
+bool CBaseReplaySerializeable::Read( KeyValues *pIn )
+{
+ m_hThis = (ReplayHandle_t)pIn->GetInt( "handle" );
+
+ return true;
+}
+
+void CBaseReplaySerializeable::Write( KeyValues *pOut )
+{
+ pOut->SetInt( "handle", (int)m_hThis );
+}
+
+const char *CBaseReplaySerializeable::GetFullFilename() const
+{
+ const char *pPath = GetPath();
+ const char *pFilename = GetFilename();
+
+ if ( !pPath || !pPath[0] || !pFilename || !pFilename[0] )
+ return NULL;
+
+ return Replay_va( "%s%s", pPath, pFilename );
+}
+
+const char *CBaseReplaySerializeable::GetFilename() const
+{
+ return Replay_va( "%s.%s", GetSubKeyTitle(), GENERIC_FILE_EXTENSION );
+}
+
+const char *CBaseReplaySerializeable::GetDebugName() const
+{
+ return GetSubKeyTitle();
+}
+
+void CBaseReplaySerializeable::SetLocked( bool bLocked )
+{
+ m_bLocked = bLocked;
+}
+
+bool CBaseReplaySerializeable::IsLocked() const
+{
+ return m_bLocked;
+}
+
+void CBaseReplaySerializeable::OnDelete()
+{
+}
+
+void CBaseReplaySerializeable::OnUnload()
+{
+}
+
+void CBaseReplaySerializeable::OnAddedToDirtyList()
+{
+}
+
+//---------------------------------------------------------------------------------------- \ No newline at end of file