summaryrefslogtreecommitdiff
path: root/game/server/tf/tf_entity_spawner.h
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 /game/server/tf/tf_entity_spawner.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/tf/tf_entity_spawner.h')
-rw-r--r--game/server/tf/tf_entity_spawner.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/game/server/tf/tf_entity_spawner.h b/game/server/tf/tf_entity_spawner.h
new file mode 100644
index 0000000..7e0b35a
--- /dev/null
+++ b/game/server/tf/tf_entity_spawner.h
@@ -0,0 +1,69 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// TF Entity Spawner
+//
+//=============================================================================
+#ifndef TF_ENTITY_SPAWNER_H
+#define TF_ENTITY_SPAWNER_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+class CEntitySpawnPoint;
+class CEntitySpawnManager;
+
+class CEntitySpawnPoint : public CServerOnlyPointEntity, public IEntityListener
+{
+public:
+ DECLARE_CLASS( CEntitySpawnPoint, CServerOnlyPointEntity );
+ DECLARE_DATADESC();
+
+ CEntitySpawnPoint() {}
+
+ virtual void Spawn( void );
+ virtual void UpdateOnRemove( void );
+ bool IsUsed( void ) { return (m_hMyEntity.Get() != NULL); }
+ void SetEntity( CBaseEntity* pEnt ) { m_hMyEntity = pEnt; }
+ void RespawnNotifyThink( void );
+
+ virtual void OnEntityDeleted( CBaseEntity* pEntity );
+
+private:
+ string_t m_iszSpawnManagerName;
+ float m_flNodeFree;
+
+ CHandle< CEntitySpawnManager > m_hSpawnManager;
+ CHandle< CBaseEntity > m_hMyEntity;
+};
+
+class CEntitySpawnManager : public CLogicalEntity
+{
+public:
+ DECLARE_CLASS( CEntitySpawnManager, CLogicalEntity );
+ DECLARE_DATADESC();
+
+ CEntitySpawnManager() {}
+
+ virtual void Spawn( void );
+ void RegisterSpawnPoint( CEntitySpawnPoint* pNewPoint );
+ virtual void Activate( void );
+ void SpawnAllEntities( void );
+ bool SpawnEntity( void );
+ int GetRespawnTime( void ) { return m_iRespawnTime; }
+
+private:
+ int GetRandomUnusedIndex( void );
+ bool SpawnEntityAt( int iIndex );
+
+private:
+ string_t m_iszEntityName;
+ int m_iEntityCount;
+ int m_iRespawnTime;
+ bool m_bDropToGround;
+ bool m_bRandomRotation;
+
+ int m_iMaxSpawnedEntities;
+ CUtlVector< CHandle< CEntitySpawnPoint > > m_SpawnPoints;
+};
+
+#endif //TF_ENTITY_SPAWNER_H \ No newline at end of file