diff options
author | rubidium <rubidium@openttd.org> | 2011-11-04 23:20:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-04 23:20:14 +0000 |
commit | 65d0d19b1616e5867afdf9d9f1c68972d2c3f2b0 (patch) | |
tree | 75d5607cc3393395003137b92c580a4bf8dae3f2 /src/ai/api/ai_controller.hpp | |
parent | 02913f40b0ab1a7771e96e4c6af4ef15b6953cc7 (diff) | |
download | openttd-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/api/ai_controller.hpp')
-rw-r--r-- | src/ai/api/ai_controller.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ai/api/ai_controller.hpp b/src/ai/api/ai_controller.hpp index 2ab7c245b..ce74d39c9 100644 --- a/src/ai/api/ai_controller.hpp +++ b/src/ai/api/ai_controller.hpp @@ -52,6 +52,16 @@ public: static uint GetTick(); /** + * Get the number of operations the AI may still execute this tick. + * @return The amount of operations left to execute. + * @note This number can go negative when certain uninteruptable + * operations are executed. The amount of operations that you go + * over the limit will be deducted from the next tick you would + * be allowed to run. + */ + static int GetOpsTillSuspend(); + + /** * Get the value of one of your settings you set via info.nut. * @param name The name of the setting. * @return the value for the setting, or -1 if the setting is not known. |