diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h | |
| download | archived-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_bot_hint_sentrygun.h')
| -rw-r--r-- | game/server/tf/bot/map_entities/tf_bot_hint_sentrygun.h | 75 |
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 |