OpenTTD GameScript API  20240419-master-g7848e80f71
Static Public Member Functions
GSNewGRF Class Reference

Class that handles all NewGRF related functions. More...

Inheritance diagram for GSNewGRF:

Static Public Member Functions

static bool IsLoaded (SQInteger grfid)
 Check if a NewGRF with a given grfid is loaded. More...
 
static SQInteger GetVersion (SQInteger grfid)
 Get the version of a loaded NewGRF. More...
 
static std::optional< std::string > GetName (SQInteger grfid)
 Get the name of a loaded NewGRF. More...
 

Detailed Description

Class that handles all NewGRF related functions.

Member Function Documentation

◆ GetName()

static std::optional<std::string> GSNewGRF::GetName ( SQInteger  grfid)
static

Get the name of a loaded NewGRF.

Parameters
grfidThe NewGRF to query.
Precondition
GSNewGRF::IsLoaded(grfid).
Returns
The name of the NewGRF or null if no name is defined.

◆ GetVersion()

static SQInteger GSNewGRF::GetVersion ( SQInteger  grfid)
static

Get the version of a loaded NewGRF.

Parameters
grfidThe NewGRF to query.
Precondition
GSNewGRF::IsLoaded(grfid).
Returns
Version of the NewGRF or 0 if the NewGRF specifies no version.

◆ IsLoaded()

static bool GSNewGRF::IsLoaded ( SQInteger  grfid)
static

Check if a NewGRF with a given grfid is loaded.

Parameters
grfidThe grfid to check.
Returns
True if and only if a NewGRF with the given grfid is loaded in the game.