summaryrefslogtreecommitdiff
path: root/game/server/tf/bot/map_entities/tf_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/bot/map_entities/tf_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/bot/map_entities/tf_spawner.h')
-rw-r--r--game/server/tf/bot/map_entities/tf_spawner.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/game/server/tf/bot/map_entities/tf_spawner.h b/game/server/tf/bot/map_entities/tf_spawner.h
new file mode 100644
index 0000000..f57db89
--- /dev/null
+++ b/game/server/tf/bot/map_entities/tf_spawner.h
@@ -0,0 +1,66 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+// tf_spawner.h
+// Entity to spawn one or more templatized entities
+// Michael Booth, April 2011
+
+#ifndef TF_SPAWNER_H
+#define TF_SPAWNER_H
+
+//--------------------------------------------------------
+/**
+ * Each particular type of entity the tf_spawner can create
+ * has an associated template (derived from this class)
+ * which defines its spawning location and initial properties.
+ */
+class CTFSpawnTemplate : public CPointEntity
+{
+public:
+ DECLARE_CLASS( CTFSpawnTemplate, CPointEntity );
+
+ virtual ~CTFSpawnTemplate() { }
+
+ virtual CBaseEntity *Instantiate( void ) const = 0; // spawn an instance of this template
+};
+
+
+//--------------------------------------------------------
+class CTFSpawner : public CPointEntity
+{
+public:
+ DECLARE_CLASS( CTFSpawner, CPointEntity );
+ DECLARE_DATADESC();
+
+ CTFSpawner( void );
+ virtual ~CTFSpawner() { }
+
+ void SpawnerThink( void );
+
+ // Input.
+ void InputReset( inputdata_t &inputdata );
+ void InputEnable( inputdata_t &inputdata );
+ void InputDisable( inputdata_t &inputdata );
+
+ // Output
+ void OnKilled( CBaseEntity *dead );
+
+private:
+ void Reset( void );
+
+ bool m_bExpended;
+ int m_spawnCount;
+ int m_spawnCountRemaining;
+ int m_maxActiveCount;
+ float m_spawnInterval;
+
+ string_t m_templateName;
+ CHandle< CTFSpawnTemplate > m_template;
+
+ COutputEvent m_onSpawned;
+ COutputEvent m_onExpended;
+ COutputEvent m_onKilled;
+
+ CUtlVector< CHandle< CBaseEntity > > m_spawnedVector;
+};
+
+
+#endif // TF_SPAWNER_H