diff options
author | zuu <zuu@openttd.org> | 2012-09-21 19:58:18 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2012-09-21 19:58:18 +0000 |
commit | f3f4c562ff0625df99782af09725391d0f1c0a8a (patch) | |
tree | 6c456062b1bf0217a16fc19e4e21f9d505baabec /src/ai/ai.hpp | |
parent | 2e1936b11cfb64f08b43e454a402b6ada276a67a (diff) | |
download | openttd-f3f4c562ff0625df99782af09725391d0f1c0a8a.tar.xz |
(svn r24537) -Feature: Scripts can be suspended even if the game is still progressing, thus break-on-log now works also for Game Scripts.
Diffstat (limited to 'src/ai/ai.hpp')
-rw-r--r-- | src/ai/ai.hpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index abe3f48ae..d3381fb8a 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -68,13 +68,30 @@ public: static void Stop(CompanyID company); /** - * Suspend an AI for the reminder of the current tick. If the AI is - * in a state when it cannot be suspended, it will continue to run - * until it can be suspended. - * @param company The company for which the AI should be suspended. + * Suspend the AI and then pause execution of the script. The script + * will not be resumed from its suspended state until the script has + * been unpaused. + * @param company The company for which the AI should be paused. * @pre Company::IsValidAiID(company) */ - static void Suspend(CompanyID company); + static void Pause(CompanyID company); + + /** + * Resume execution of the AI. This function will not actually execute + * the script, but set a flag so that the script is executed my the usual + * mechanism that executes the script. + * @param company The company for which the AI should be unpaused. + * @pre Company::IsValidAiID(company) + */ + static void Unpause(CompanyID company); + + /** + * Checks if the AI is paused. + * @param company The company for which to check if the AI is paused. + * @pre Company::IsValidAiID(company) + * @return true if the AI is paused, otherwise false. + */ + static bool IsPaused(CompanyID company); /** * Kill any and all AIs we manage. |