MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Script_Suspend

Class Script_Suspend

src/script/script_suspend.hpp:21–48  ·  view source on GitHub ↗

* A throw-class that is given when the script wants to suspend. */

Source from the content-addressed store, hash-verified

19 * A throw-class that is given when the script wants to suspend.
20 */
21class Script_Suspend {
22public:
23 /**
24 * Create the suspend exception.
25 * @param time The amount of ticks to suspend.
26 * @param callback The callback to call when the script may resume again.
27 */
28 Script_Suspend(int time, Script_SuspendCallbackProc *callback) :
29 time(time),
30 callback(callback)
31 {}
32
33 /**
34 * Get the amount of ticks the script should be suspended.
35 * @return The amount of ticks to suspend the script.
36 */
37 int GetSuspendTime() { return time; }
38
39 /**
40 * Get the callback to call when the script can run again.
41 * @return The callback function to run.
42 */
43 Script_SuspendCallbackProc *GetSuspendCallback() { return callback; }
44
45private:
46 int time; ///< Amount of ticks to suspend the script.
47 Script_SuspendCallbackProc *callback; ///< Callback function to call when the script can run again.
48};
49
50#endif /* SCRIPT_SUSPEND_HPP */

Callers 2

SleepMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected