Class that handles all sign related functions. More...
#include <script_sign.hpp>
Public Types | |
| enum | ErrorMessages { ERR_SIGN_BASE = ScriptError::ERR_CAT_SIGN << ScriptError::ERR_CAT_BIT_SIZE, ERR_SIGN_TOO_MANY_SIGNS } |
All sign related error messages. More... | |
Static Public Member Functions | |
| static bool | IsValidSign (SignID sign_id) |
| Checks whether the given sign index is valid. | |
| static bool | SetName (SignID sign_id, Text *name) |
| Set the name of a sign. | |
| static char * | GetName (SignID sign_id) |
| Get the name of the sign. | |
| static ScriptCompany::CompanyID | GetOwner (SignID sign_id) |
| Get the owner of a sign. | |
| static TileIndex | GetLocation (SignID sign_id) |
| Gets the location of the sign. | |
| static SignID | BuildSign (TileIndex location, Text *name) |
| Builds a sign on the map. | |
| static bool | RemoveSign (SignID sign_id) |
| Removes a sign from the map. | |
Class that handles all sign related functions.
ai game
Definition at line 22 of file script_sign.hpp.
All sign related error messages.
| ERR_SIGN_BASE |
Base for sign building related errors. |
| ERR_SIGN_TOO_MANY_SIGNS |
Too many signs have been placed. |
Definition at line 27 of file script_sign.hpp.
Builds a sign on the map.
| location | The place to build the sign. | |
| name | The text to place on the sign (can be either a raw string, or a ScriptText object). |
| ScriptSign::ERR_SIGN_TOO_MANY_SIGNS |
Definition at line 76 of file script_sign.cpp.
References CMD_PLACE_SIGN, ScriptObject::DoCommand(), ScriptInstance::DoCommandReturnSignID(), EnforcePrecondition, EnforcePreconditionCustomError, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG, Text::GetEncodedText(), INVALID_SIGN, IsValidTile(), MAX_LENGTH_SIGN_NAME_CHARS, StrEmpty(), and Utf8StringLength().
Gets the location of the sign.
| sign_id | The sign to get the location of. |
Definition at line 62 of file script_sign.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_sign_pool >::Get(), INVALID_TILE, IsValidSign(), and TileVirtXY().
| char * ScriptSign::GetName | ( | SignID | sign_id | ) | [static] |
Get the name of the sign.
| sign_id | The sign to get the name of. |
Definition at line 49 of file script_sign.cpp.
References IsValidSign(), and SetDParam().
| ScriptCompany::CompanyID ScriptSign::GetOwner | ( | SignID | sign_id | ) | [static] |
Get the owner of a sign.
| sign_id | The sign to get the owner of. |
Definition at line 29 of file script_sign.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_sign_pool >::Get(), and IsValidSign().
| bool ScriptSign::IsValidSign | ( | SignID | sign_id | ) | [static] |
Checks whether the given sign index is valid.
| sign_id | The index to check. |
Definition at line 23 of file script_sign.cpp.
References ScriptObject::GetCompany(), and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_sign_pool >::GetIfValid().
Referenced by GetLocation(), GetName(), GetOwner(), RemoveSign(), and SetName().
| bool ScriptSign::RemoveSign | ( | SignID | sign_id | ) | [static] |
Removes a sign from the map.
| sign_id | The sign to remove. |
Definition at line 70 of file script_sign.cpp.
References CMD_RENAME_SIGN, ScriptObject::DoCommand(), EnforcePrecondition, and IsValidSign().
Set the name of a sign.
| sign_id | The sign to set the name for. | |
| name | The name for the sign (can be either a raw string, or a ScriptText object). |
| ScriptError::ERR_NAME_IS_NOT_UNIQUE |
Definition at line 36 of file script_sign.cpp.
References CMD_RENAME_SIGN, ScriptObject::DoCommand(), EnforcePrecondition, EnforcePreconditionCustomError, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG, Text::GetEncodedText(), IsValidSign(), MAX_LENGTH_SIGN_NAME_CHARS, StrEmpty(), and Utf8StringLength().
1.7.1