OpenTTD Source 20241224-master-gee860a5c8e
|
A controller to start enough so we can use Squirrel for testing. More...
Data Fields | |
GameInstance | game {} |
ScriptObject::ActiveInstance | active {&game} |
Squirrel | engine {"test"} |
ScriptAllocatorScope | scope {&engine} |
A controller to start enough so we can use Squirrel for testing.
To run Squirrel, we need an Allocator, so malloc/free works. For functions that log, we need an ActiveInstance, so the logger knows where to send the logs to.
By instantiating this class, both are set correctly. After that you can use Squirrel without issues.
Definition at line 35 of file test_script_admin.cpp.
ScriptObject::ActiveInstance TestScriptController::active {&game} |
Definition at line 38 of file test_script_admin.cpp.
Squirrel TestScriptController::engine {"test"} |
Definition at line 40 of file test_script_admin.cpp.
GameInstance TestScriptController::game {} |
Definition at line 37 of file test_script_admin.cpp.
ScriptAllocatorScope TestScriptController::scope {&engine} |
Definition at line 41 of file test_script_admin.cpp.