diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/shared/mapentities_shared.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/shared/mapentities_shared.h')
| -rw-r--r-- | mp/src/game/shared/mapentities_shared.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mp/src/game/shared/mapentities_shared.h b/mp/src/game/shared/mapentities_shared.h new file mode 100644 index 00000000..4ebee4fa --- /dev/null +++ b/mp/src/game/shared/mapentities_shared.h @@ -0,0 +1,50 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef MAPENTITIES_SHARED_H
+#define MAPENTITIES_SHARED_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#define MAPKEY_MAXLENGTH 2048
+
+
+//-----------------------------------------------------------------------------
+// Purpose: encapsulates the data string in the map file
+// that is used to initialise entities. The data
+// string contains a set of key/value pairs.
+//-----------------------------------------------------------------------------
+class CEntityMapData
+{
+private:
+ char *m_pEntData;
+ int m_nEntDataSize;
+ char *m_pCurrentKey;
+
+public:
+ explicit CEntityMapData( char *entBlock, int nEntBlockSize = -1 ) :
+ m_pEntData(entBlock), m_nEntDataSize(nEntBlockSize), m_pCurrentKey(entBlock) {}
+
+ // find the keyName in the entdata and puts it's value into Value. returns false if key is not found
+ bool ExtractValue( const char *keyName, char *Value );
+
+ // find the nth keyName in the endata and change its value to specified one
+ // where n == nKeyInstance
+ bool SetValue( const char *keyName, char *NewValue, int nKeyInstance = 0 );
+
+ bool GetFirstKey( char *keyName, char *Value );
+ bool GetNextKey( char *keyName, char *Value );
+
+ const char *CurrentBufferPosition( void );
+};
+
+const char *MapEntity_ParseToken( const char *data, char *newToken );
+const char *MapEntity_SkipToNextEntity( const char *pMapData, char *pWorkBuffer );
+bool MapEntity_ExtractValue( const char *pEntData, const char *keyName, char Value[MAPKEY_MAXLENGTH] );
+
+
+#endif // MAPENTITIES_SHARED_H
|