OpenTTD Source 20260311-master-g511d3794ce
GameLibrary Class Reference

All static information from an Game library like name, version, etc. More...

#include <game_info.hpp>

Inheritance diagram for GameLibrary:
ScriptInfo

Public Member Functions

const std::string & GetCategory () const
 Get the category this library is in.
Public Member Functions inherited from ScriptInfo
const std::string & GetAuthor () const
 Get the Author of the script.
const std::string & GetName () const
 Get the Name of the script.
const std::string & GetShortName () const
 Get the 4 character long short name of the script.
const std::string & GetDescription () const
 Get the description of the script.
int GetVersion () const
 Get the version of the script.
const std::string & GetDate () const
 Get the last-modified date of the script.
const std::string & GetInstanceName () const
 Get the name of the instance of the script to create.
const std::string & GetURL () const
 Get the website for this script.
const std::string & GetMainScript () const
 Get the filename of the main.nut script.
const std::string & GetTarFile () const
 Get the filename of the tar the script is in.
bool CheckMethod (std::string_view name) const
 Check if a given method exists.
virtual class ScriptScannerGetScanner ()
 Get the scanner which has found this ScriptInfo.
bool GetSettings ()
 Does this script have a 'GetSettings' function?
const ScriptConfigItemListGetConfigList () const
 Get the config list for this Script.
const ScriptConfigItemGetConfigItem (std::string_view name) const
 Get the description of a certain Script config option.
SQInteger AddSetting (HSQUIRRELVM vm)
 Add a setting.
SQInteger AddLabels (HSQUIRRELVM vm)
 Add labels for a setting.
int GetSettingDefaultValue (const std::string &name) const
 Get the default value for a setting.
virtual bool IsDeveloperOnly () const
 Can this script be selected by developers only?

Static Public Member Functions

static void RegisterAPI (Squirrel &engine)
 Register the functions of this class.
static SQInteger Constructor (HSQUIRRELVM vm)
 Create an GSLibrary, using this GSInfo as start-template.
Static Public Member Functions inherited from ScriptInfo
static SQInteger Constructor (HSQUIRRELVM vm, ScriptInfo &info)
 Process the creation of a FileInfo object.

Private Attributes

std::string category
 The category this library is in.

Additional Inherited Members

Protected Attributes inherited from ScriptInfo
class Squirrelengine = nullptr
 Engine used to register for Squirrel.
HSQOBJECT SQ_instance {}
 The Squirrel instance created for this info.
ScriptConfigItemList config_list {}
 List of settings from this Script.

Detailed Description

All static information from an Game library like name, version, etc.

Definition at line 58 of file game_info.hpp.

Constructor & Destructor Documentation

◆ GameLibrary()

GameLibrary::GameLibrary ( )
inline

Definition at line 60 of file game_info.hpp.

Member Function Documentation

◆ Constructor()

SQInteger GameLibrary::Constructor ( HSQUIRRELVM vm)
static

Create an GSLibrary, using this GSInfo as start-template.

Parameters
vmThe virtual machine to push the instance to.
Returns
The number of stack places occupied.

Definition at line 107 of file game_info.cpp.

References ScriptInfo::Constructor(), MAX_GET_OPS, and ScriptInfo::scanner.

Referenced by RegisterAPI().

◆ GetCategory()

const std::string & GameLibrary::GetCategory ( ) const
inline

Get the category this library is in.

Returns
The category.

Definition at line 79 of file game_info.hpp.

References category.

Referenced by GameScannerLibrary::GetScriptName().

◆ RegisterAPI()

void GameLibrary::RegisterAPI ( Squirrel & engine)
static

Register the functions of this class.

Parameters
engineThe engine to register to.

Definition at line 99 of file game_info.cpp.

References Constructor(), and ScriptInfo::engine.

Referenced by GameScannerLibrary::RegisterAPI().

Field Documentation

◆ category

std::string GameLibrary::category
private

The category this library is in.

Definition at line 82 of file game_info.hpp.

Referenced by GetCategory().


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