aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/shared/activitylist.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/shared/activitylist.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/shared/activitylist.h')
-rw-r--r--sp/src/game/shared/activitylist.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/sp/src/game/shared/activitylist.h b/sp/src/game/shared/activitylist.h
new file mode 100644
index 00000000..2baaa115
--- /dev/null
+++ b/sp/src/game/shared/activitylist.h
@@ -0,0 +1,100 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef ACTIVITYLIST_H
+#define ACTIVITYLIST_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <KeyValues.h>
+
+typedef struct activityentry_s activityentry_t;
+
+class CActivityRemap
+{
+public:
+
+ CActivityRemap()
+ {
+ pExtraBlock = NULL;
+ }
+
+ void SetExtraKeyValueBlock ( KeyValues *pKVBlock )
+ {
+ pExtraBlock = pKVBlock;
+ }
+
+ KeyValues *GetExtraKeyValueBlock ( void ) { return pExtraBlock; }
+
+ Activity activity;
+ Activity mappedActivity;
+
+private:
+
+ KeyValues *pExtraBlock;
+};
+
+
+class CActivityRemapCache
+{
+public:
+
+ CActivityRemapCache()
+ {
+ }
+
+ CActivityRemapCache( const CActivityRemapCache& src )
+ {
+ int c = src.m_cachedActivityRemaps.Count();
+ for ( int i = 0; i < c; i++ )
+ {
+ m_cachedActivityRemaps.AddToTail( src.m_cachedActivityRemaps[ i ] );
+ }
+ }
+
+ CActivityRemapCache& operator = ( const CActivityRemapCache& src )
+ {
+ if ( this == &src )
+ return *this;
+
+ int c = src.m_cachedActivityRemaps.Count();
+ for ( int i = 0; i < c; i++ )
+ {
+ m_cachedActivityRemaps.AddToTail( src.m_cachedActivityRemaps[ i ] );
+ }
+
+ return *this;
+ }
+
+ CUtlVector< CActivityRemap > m_cachedActivityRemaps;
+};
+
+void UTIL_LoadActivityRemapFile( const char *filename, const char *section, CUtlVector <CActivityRemap> &entries );
+
+//=========================================================
+//=========================================================
+extern void ActivityList_Init( void );
+extern void ActivityList_Free( void );
+extern bool ActivityList_RegisterSharedActivity( const char *pszActivityName, int iActivityIndex );
+extern Activity ActivityList_RegisterPrivateActivity( const char *pszActivityName );
+extern int ActivityList_IndexForName( const char *pszActivityName );
+extern const char *ActivityList_NameForIndex( int iActivityIndex );
+extern int ActivityList_HighestIndex();
+
+// This macro guarantees that the names of each activity and the constant used to
+// reference it in the code are identical.
+#define REGISTER_SHARED_ACTIVITY( _n ) ActivityList_RegisterSharedActivity(#_n, _n);
+#define REGISTER_PRIVATE_ACTIVITY( _n ) _n = ActivityList_RegisterPrivateActivity( #_n );
+
+// Implemented in shared code
+extern void ActivityList_RegisterSharedActivities( void );
+
+class ISaveRestoreOps;
+extern ISaveRestoreOps* ActivityDataOps();
+
+#endif // ACTIVITYLIST_H