OpenTTD Source  20240919-master-gdf0233f4c2
Script_Suspend Class Reference

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

#include <script_suspend.hpp>

Public Member Functions

 Script_Suspend (int time, Script_SuspendCallbackProc *callback)
 Create the suspend exception. More...
 
int GetSuspendTime ()
 Get the amount of ticks the script should be suspended. More...
 
Script_SuspendCallbackProcGetSuspendCallback ()
 Get the callback to call when the script can run again. More...
 

Private Attributes

int time
 Amount of ticks to suspend the script.
 
Script_SuspendCallbackProccallback
 Callback function to call when the script can run again.
 

Detailed Description

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

Definition at line 21 of file script_suspend.hpp.

Constructor & Destructor Documentation

◆ Script_Suspend()

Script_Suspend::Script_Suspend ( int  time,
Script_SuspendCallbackProc callback 
)
inline

Create the suspend exception.

Parameters
timeThe amount of ticks to suspend.
callbackThe callback to call when the script may resume again.

Definition at line 28 of file script_suspend.hpp.

Member Function Documentation

◆ GetSuspendCallback()

Script_SuspendCallbackProc* Script_Suspend::GetSuspendCallback ( )
inline

Get the callback to call when the script can run again.

Returns
The callback function to run.

Definition at line 43 of file script_suspend.hpp.

References callback.

Referenced by ScriptInstance::GameLoop().

◆ GetSuspendTime()

int Script_Suspend::GetSuspendTime ( )
inline

Get the amount of ticks the script should be suspended.

Returns
The amount of ticks to suspend the script.

Definition at line 37 of file script_suspend.hpp.

References time.

Referenced by ScriptInstance::GameLoop().


The documentation for this class was generated from the following file: