OpenTTD GameScript API 20241220-master-g59680867c3
Public Member Functions
GSAsyncMode Class Reference

Class to switch current mode to Async Mode. More...

#include <script_asyncmode.hpp>

Inheritance diagram for GSAsyncMode:

Public Member Functions

 GSAsyncMode (bool asynchronous)
 Creating instance of this class switches the build mode to Asynchronous or Non-Asynchronous (normal).
 

Detailed Description

Class to switch current mode to Async Mode.

If you create an instance of this class, the mode will be switched to either Asynchronous or Non-Asynchronous mode. The original mode is stored and recovered from when ever the instance is destroyed. In Asynchronous mode all the commands you execute are queued for later execution. The system checks if it would be able to execute your requests, and returns what the cost would be. The actual cost and whether the command succeeded when the command is eventually executed may differ from what was reported to the script.

Constructor & Destructor Documentation

◆ GSAsyncMode()

GSAsyncMode::GSAsyncMode ( bool  asynchronous)

Creating instance of this class switches the build mode to Asynchronous or Non-Asynchronous (normal).

Note
When the instance is destroyed, it restores the mode that was current when the instance was created!
Parameters
asynchronousWhether the new mode should be Asynchronous, if true, or Non-Asynchronous, if false.