Class to switch current mode to Test Mode. More...
#include <script_testmode.hpp>
Public Member Functions | |
ScriptTestMode () | |
Creating instance of this class switches the build mode to Testing. | |
~ScriptTestMode () | |
Destroying this instance reset the building mode to the mode it was in when the instance was created. | |
Static Protected Member Functions | |
static bool | ModeProc () |
The callback proc for Testing mode. | |
Private Attributes | |
ScriptModeProc * | last_mode |
The previous mode we were in. | |
ScriptObject * | last_instance |
The previous instace of the mode. |
Class to switch current mode to Test Mode.
If you create an instance of this class, the mode will be switched to Testing. The original mode is stored and recovered from when ever the instance is destroyed. In Test mode all the commands you execute aren't really executed. The system only checks if it would be able to execute your requests, and what the cost would be. ai game
Definition at line 27 of file script_testmode.hpp.
ScriptTestMode::ScriptTestMode | ( | ) |
Creating instance of this class switches the build mode to Testing.
Definition at line 26 of file script_testmode.cpp.
References ScriptObject::GetDoCommandMode(), ScriptObject::GetDoCommandModeInstance(), last_instance, last_mode, ModeProc(), and ScriptObject::SetDoCommandMode().