summaryrefslogtreecommitdiff
path: root/game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h')
-rw-r--r--game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h b/game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h
new file mode 100644
index 0000000..e2b0440
--- /dev/null
+++ b/game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h
@@ -0,0 +1,75 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+// tf_bot_hint_sentrygun.h
+// Designer-placed hint for bot sentry placement
+// Michael Booth, October 2009
+
+#ifndef TF_BOT_HINT_SENTRYGUN_H
+#define TF_BOT_HINT_SENTRYGUN_H
+
+#include "tf_bot_hint_entity.h"
+
+class CTFPlayer;
+
+class CTFBotHintSentrygun : public CBaseTFBotHintEntity
+{
+public:
+ DECLARE_CLASS( CTFBotHintSentrygun, CBaseTFBotHintEntity );
+ DECLARE_DATADESC();
+
+ CTFBotHintSentrygun( void );
+ virtual ~CTFBotHintSentrygun() { }
+
+ bool IsSticky() const;
+ bool IsInUse() const;
+
+ CTFPlayer *GetPlayerOwner() const;
+ void SetPlayerOwner( CTFPlayer *pPlayerOwner );
+
+ void IncrementUseCount();
+ void DecrementUseCount();
+
+ void OnSentryGunDestroyed( CBaseEntity *pBaseEntity );
+
+ bool IsAvailableForSelection( CTFPlayer *pRequestingPlayer ) const;
+
+ virtual HintType GetHintType() const OVERRIDE { return HINT_SENTRYGUN; }
+
+private:
+ bool m_isSticky;
+ int m_iUseCount;
+ COutputEvent m_outputOnSentryGunDestroyed;
+
+ CHandle< CTFPlayer > m_playerOwner;
+};
+
+inline bool CTFBotHintSentrygun::IsSticky() const
+{
+ return m_isSticky;
+}
+
+inline bool CTFBotHintSentrygun::IsInUse() const
+{
+ return m_iUseCount != 0;
+}
+
+inline CTFPlayer *CTFBotHintSentrygun::GetPlayerOwner() const
+{
+ return m_playerOwner;
+}
+
+inline void CTFBotHintSentrygun::SetPlayerOwner( CTFPlayer *pPlayerOwner )
+{
+ m_playerOwner = pPlayerOwner;
+}
+
+inline void CTFBotHintSentrygun::IncrementUseCount()
+{
+ ++m_iUseCount;
+}
+
+inline void CTFBotHintSentrygun::DecrementUseCount()
+{
+ --m_iUseCount;
+}
+
+#endif // TF_BOT_HINT_SENTRYGUN_H