summaryrefslogtreecommitdiff
path: root/src/ai/ai_instance.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-04 23:20:14 +0000
committerrubidium <rubidium@openttd.org>2011-11-04 23:20:14 +0000
commit65d0d19b1616e5867afdf9d9f1c68972d2c3f2b0 (patch)
tree75d5607cc3393395003137b92c580a4bf8dae3f2 /src/ai/ai_instance.hpp
parent02913f40b0ab1a7771e96e4c6af4ef15b6953cc7 (diff)
downloadopenttd-65d0d19b1616e5867afdf9d9f1c68972d2c3f2b0.tar.xz
(svn r23118) -Feature: [NoAI] Allow AIs to query the amount of remaining operations for the current tick
Diffstat (limited to 'src/ai/ai_instance.hpp')
-rw-r--r--src/ai/ai_instance.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp
index 718531feb..d66854563 100644
--- a/src/ai/ai_instance.hpp
+++ b/src/ai/ai_instance.hpp
@@ -172,6 +172,13 @@ public:
* call from within a function called by the AI.
*/
void Suspend();
+
+ /**
+ * Get the number of operations the AI can execute before being suspended.
+ * This function is safe to call from within a function called by the AI.
+ * @return The number of operations to execute.
+ */
+ SQInteger GetOpsTillSuspend();
private:
class AIController *controller; ///< The AI main class.
class AIStorage *storage; ///< Some global information for each running AI.