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 /sp/src/game/server/mapentities.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/server/mapentities.h')
| -rw-r--r-- | sp/src/game/server/mapentities.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sp/src/game/server/mapentities.h b/sp/src/game/server/mapentities.h new file mode 100644 index 00000000..5fd075aa --- /dev/null +++ b/sp/src/game/server/mapentities.h @@ -0,0 +1,47 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef MAPENTITIES_H
+#define MAPENTITIES_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "mapentities_shared.h"
+
+// This class provides hooks into the map-entity loading process that allows CS to do some tricks
+// when restarting the round. The main trick it tries to do is recreate all
+abstract_class IMapEntityFilter
+{
+public:
+ virtual bool ShouldCreateEntity( const char *pClassname ) = 0;
+ virtual CBaseEntity* CreateNextEntity( const char *pClassname ) = 0;
+};
+
+// Use the filter so you can prevent certain entities from being created out of the map.
+// CSPort does this when restarting rounds. It wants to reload most entities from the map, but certain
+// entities like the world entity need to be left intact.
+void MapEntity_ParseAllEntities( const char *pMapData, IMapEntityFilter *pFilter=NULL, bool bActivateEntities=false );
+
+const char *MapEntity_ParseEntity( CBaseEntity *&pEntity, const char *pEntData, IMapEntityFilter *pFilter );
+void MapEntity_PrecacheEntity( const char *pEntData, int &nStringSize );
+
+
+//-----------------------------------------------------------------------------
+// Hierarchical spawn
+//-----------------------------------------------------------------------------
+struct HierarchicalSpawn_t
+{
+ CBaseEntity *m_pEntity;
+ int m_nDepth;
+ CBaseEntity *m_pDeferredParent; // attachment parents can't be set until the parents are spawned
+ const char *m_pDeferredParentAttachment; // so defer setting them up until the second pass
+};
+
+void SpawnHierarchicalList( int nEntities, HierarchicalSpawn_t *pSpawnList, bool bActivateEntities );
+
+#endif // MAPENTITIES_H
|