OpenTTD Source 20241224-master-gee860a5c8e
ScriptStorage Class Reference

The storage for each script. More...

#include <script_storage.hpp>

Private Attributes

ScriptModeProcmode
 The current build mode we are int.
 
class ScriptObject * mode_instance
 The instance belonging to the current build mode.
 
ScriptAsyncModeProcasync_mode
 The current command async mode we are in.
 
class ScriptObject * async_mode_instance
 The instance belonging to the current command async mode.
 
CompanyID root_company
 The root company, the company that the script really belongs to.
 
CompanyID company
 The current company.
 
uint delay
 The ticks of delay each DoCommand has.
 
bool allow_do_command
 Is the usage of DoCommands restricted?
 
CommandCost costs
 The costs the script is tracking.
 
Money last_cost
 The last cost of the command.
 
uint last_error
 The last error of the command.
 
bool last_command_res
 The last result of the command.
 
CommandDataBuffer last_data
 The last data passed to a command.
 
Commands last_cmd
 The last cmd passed to a command.
 
CommandDataBuffer last_cmd_ret
 The extra data returned by the last command.
 
std::vector< int > callback_value
 The values which need to survive a callback.
 
RoadType road_type
 The current roadtype we build.
 
RailType rail_type
 The current railtype we build.
 
void * event_data
 Pointer to the event data storage.
 
ScriptLogTypes::LogData log_data
 Log data storage.
 

Friends

class ScriptObject
 

Detailed Description

The storage for each script.

It keeps track of important information.

Definition at line 37 of file script_storage.hpp.

Constructor & Destructor Documentation

◆ ScriptStorage()

ScriptStorage::ScriptStorage ( )
inline

Definition at line 68 of file script_storage.hpp.

◆ ~ScriptStorage()

ScriptStorage::~ScriptStorage ( )

Definition at line 35 of file script_instance.cpp.

Friends And Related Symbol Documentation

◆ ScriptObject

friend class ScriptObject
friend

Definition at line 38 of file script_storage.hpp.

Field Documentation

◆ allow_do_command

bool ScriptStorage::allow_do_command
private

Is the usage of DoCommands restricted?

Definition at line 48 of file script_storage.hpp.

◆ async_mode

ScriptAsyncModeProc* ScriptStorage::async_mode
private

The current command async mode we are in.

Definition at line 42 of file script_storage.hpp.

◆ async_mode_instance

class ScriptObject* ScriptStorage::async_mode_instance
private

The instance belonging to the current command async mode.

Definition at line 43 of file script_storage.hpp.

◆ callback_value

std::vector<int> ScriptStorage::callback_value
private

The values which need to survive a callback.

Definition at line 59 of file script_storage.hpp.

◆ company

CompanyID ScriptStorage::company
private

The current company.

Definition at line 45 of file script_storage.hpp.

◆ costs

CommandCost ScriptStorage::costs
private

The costs the script is tracking.

Definition at line 50 of file script_storage.hpp.

◆ delay

uint ScriptStorage::delay
private

The ticks of delay each DoCommand has.

Definition at line 47 of file script_storage.hpp.

◆ event_data

void* ScriptStorage::event_data
private

Pointer to the event data storage.

Definition at line 64 of file script_storage.hpp.

◆ last_cmd

Commands ScriptStorage::last_cmd
private

The last cmd passed to a command.

Definition at line 56 of file script_storage.hpp.

◆ last_cmd_ret

CommandDataBuffer ScriptStorage::last_cmd_ret
private

The extra data returned by the last command.

Definition at line 57 of file script_storage.hpp.

◆ last_command_res

bool ScriptStorage::last_command_res
private

The last result of the command.

Definition at line 53 of file script_storage.hpp.

◆ last_cost

Money ScriptStorage::last_cost
private

The last cost of the command.

Definition at line 51 of file script_storage.hpp.

◆ last_data

CommandDataBuffer ScriptStorage::last_data
private

The last data passed to a command.

Definition at line 55 of file script_storage.hpp.

◆ last_error

uint ScriptStorage::last_error
private

The last error of the command.

Definition at line 52 of file script_storage.hpp.

◆ log_data

ScriptLogTypes::LogData ScriptStorage::log_data
private

Log data storage.

Definition at line 65 of file script_storage.hpp.

◆ mode

ScriptModeProc* ScriptStorage::mode
private

The current build mode we are int.

Definition at line 40 of file script_storage.hpp.

◆ mode_instance

class ScriptObject* ScriptStorage::mode_instance
private

The instance belonging to the current build mode.

Definition at line 41 of file script_storage.hpp.

◆ rail_type

RailType ScriptStorage::rail_type
private

The current railtype we build.

Definition at line 62 of file script_storage.hpp.

◆ road_type

RoadType ScriptStorage::road_type
private

The current roadtype we build.

Definition at line 61 of file script_storage.hpp.

◆ root_company

CompanyID ScriptStorage::root_company
private

The root company, the company that the script really belongs to.

Definition at line 44 of file script_storage.hpp.


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