OpenTTD Source  14.0-beta1
TestScriptController Class Reference

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}
 

Detailed Description

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.


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