forked from sears2424/Source-PlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivitylist.h
100 lines (76 loc) · 2.41 KB
/
activitylist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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