OpenTTD Source: TestScriptController Class Reference

OpenTTD Source 15.3

Data Fields
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 37 of file test_script_admin.cpp.

## Field Documentation

## ◆ active

ScriptObject::ActiveInstance TestScriptController::active {game}

Definition at line 40 of file test_script_admin.cpp.

## ◆ engine

Squirrel TestScriptController::engine {"test"}

Definition at line 42 of file test_script_admin.cpp.

## ◆ game

GameInstance TestScriptController::game {}

Definition at line 39 of file test_script_admin.cpp.

## ◆ scope

ScriptAllocatorScope TestScriptController::scope {&engine}

Definition at line 43 of file test_script_admin.cpp.

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

- src/tests/test_script_admin.cpp