OpenTTD GameScript API 20261112-master-gbcbec5e63f
GSDepot Class Reference

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

#include <script_depot.hpp>

Inheritance diagram for GSDepot:

Public Types

enum  ErrorMessages { ERR_DEPOT_BASE }
 All depot related error messages. More...

Static Public Member Functions

static string GetName (TileIndex tile)
 Get the name of a depot.
static bool SetName (TileIndex tile, Text *name)
 Set the name of your own depot.

Detailed Description

Class that handles all depot related functions.

Member Enumeration Documentation

◆ ErrorMessages

All depot related error messages.

See also
ScriptErrorType
Enumerator
ERR_DEPOT_BASE 

Base for depot related errors.

Member Function Documentation

◆ GetName()

string GSDepot::GetName ( TileIndex tile)
static

Get the name of a depot.

Parameters
tileThe depot tile to get the name of.
Returns
The name of the depot.
Note
Hangar names can't be retrieved.

◆ SetName()

bool GSDepot::SetName ( TileIndex tile,
Text * name )
static

Set the name of your own depot.

Parameters
tileThe depot tile to set the name of.
nameThe new name of the depot (can be either a raw string, or a GSText object).
Precondition
GSCompany::IsMine(GSTile::GetOwner(tile)).
name != null && len(name) != 0.
GSCompanyMode::IsValid().
Exceptions
GSError::ERR_NAME_IS_NOT_UNIQUE
Returns
True if the name was changed.
Note
Hangar names can't be set.