summaryrefslogtreecommitdiff
path: root/game/server/tf/bot/behavior/tf_bot_use_teleporter.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/server/tf/bot/behavior/tf_bot_use_teleporter.h')
-rw-r--r--game/server/tf/bot/behavior/tf_bot_use_teleporter.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/game/server/tf/bot/behavior/tf_bot_use_teleporter.h b/game/server/tf/bot/behavior/tf_bot_use_teleporter.h
new file mode 100644
index 0000000..6b36b33
--- /dev/null
+++ b/game/server/tf/bot/behavior/tf_bot_use_teleporter.h
@@ -0,0 +1,40 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+// tf_bot_use_teleporter.h
+// Ride a friendly teleporter
+// Michael Booth, May 2010
+
+#ifndef TF_BOT_USE_TELEPORTER_H
+#define TF_BOT_USE_TELEPORTER_H
+
+#include "tf_obj_teleporter.h"
+#include "Path/NextBotPathFollow.h"
+
+class CTFBotUseTeleporter : public Action< CTFBot >
+{
+public:
+ enum UseHowType
+ {
+ USE_IF_READY,
+ ALWAYS_USE
+ };
+ CTFBotUseTeleporter( CObjectTeleporter *teleporter, UseHowType how = USE_IF_READY );
+
+ virtual ActionResult< CTFBot > OnStart( CTFBot *me, Action< CTFBot > *priorAction );
+ virtual ActionResult< CTFBot > Update( CTFBot *me, float interval );
+
+ virtual const char *GetName( void ) const { return "UseTeleporter"; };
+
+private:
+ CHandle< CObjectTeleporter > m_teleporter; // the teleporter we're trying to use
+ UseHowType m_how;
+
+ PathFollower m_path;
+ CountdownTimer m_repathTimer;
+
+ bool m_isInTransit;
+
+ bool IsTeleporterAvailable( void ) const;
+};
+
+
+#endif // TF_BOT_USE_TELEPORTER_H