OpenTTD AI API 20261125-master-g871c4f4cb5
AIDepot Class Reference

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

#include <script_depot.hpp>

Inheritance diagram for AIDepot:

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 AIDepot::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 AIDepot::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 AIText object).
Precondition
AICompany::IsMine(AITile::GetOwner(tile)).
name != null && len(name) != 0.
Exceptions
AIError::ERR_NAME_IS_NOT_UNIQUE
Returns
True if the name was changed.
Note
Hangar names can't be set.