#include <ai_sign.hpp>
Public Types | |
enum | ErrorMessages { ERR_SIGN_BASE = AIError::ERR_CAT_SIGN << AIError::ERR_CAT_BIT_SIZE, ERR_SIGN_TOO_MANY_SIGNS } |
All sign related error messages. More... | |
Static Public Member Functions | |
static const char * | GetClassName () |
static SignID | GetMaxSignID () |
Gets the maximum sign index; there are no valid signs with a higher index. | |
static bool | IsValidSign (SignID sign_id) |
Checks whether the given sign index is valid. | |
static bool | SetName (SignID sign_id, const char *name) |
Set the name of a sign. | |
static char * | GetName (SignID sign_id) |
Get the name of the sign. | |
static TileIndex | GetLocation (SignID sign_id) |
Gets the location of the sign. | |
static SignID | BuildSign (TileIndex location, const char *text) |
Builds a sign on the map. | |
static bool | RemoveSign (SignID sign_id) |
Removes a sign from the map. |
Definition at line 15 of file ai_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 22 of file ai_sign.hpp.
SignID AISign::GetMaxSignID | ( | ) | [static] |
Gets the maximum sign index; there are no valid signs with a higher index.
Definition at line 16 of file ai_sign.cpp.
bool AISign::IsValidSign | ( | SignID | sign_id | ) | [static] |
Checks whether the given sign index is valid.
sign_id | The index to check. |
Definition at line 21 of file ai_sign.cpp.
Referenced by GetLocation(), GetName(), RemoveSign(), and SetName().
bool AISign::SetName | ( | SignID | sign_id, | |
const char * | name | |||
) | [static] |
Set the name of a sign.
sign_id | The sign to set the name for. | |
name | The name for the sign. |
'name' must have at least one character.
'name' must have at most 30 characters.
AIError::ERR_NAME_IS_NOT_UNIQUE |
Definition at line 26 of file ai_sign.cpp.
References CMD_RENAME_SIGN, AIObject::DoCommand(), EnforcePrecondition, EnforcePreconditionCustomError, AIError::ERR_PRECONDITION_STRING_TOO_LONG, IsValidSign(), MAX_LENGTH_SIGN_NAME_BYTES, and StrEmpty().
char * AISign::GetName | ( | SignID | sign_id | ) | [static] |
Get the name of the sign.
sign_id | The sign to get the name of. |
Definition at line 35 of file ai_sign.cpp.
References IsValidSign().
Gets the location of the sign.
sign_id | The sign to get the location of. |
Definition at line 48 of file ai_sign.cpp.
References INVALID_TILE, and IsValidSign().
Builds a sign on the map.
location | The place to build the sign. | |
text | The text to place on the sign. |
'text' must have at least one character.
'text' must have at most 30 characters.
AISign::ERR_SIGN_TOO_MANY_SIGNS |
Definition at line 62 of file ai_sign.cpp.
References CMD_PLACE_SIGN, AIObject::DoCommand(), EnforcePrecondition, EnforcePreconditionCustomError, AIError::ERR_PRECONDITION_STRING_TOO_LONG, IsValidTile(), MAX_LENGTH_SIGN_NAME_BYTES, and StrEmpty().
bool AISign::RemoveSign | ( | SignID | sign_id | ) | [static] |
Removes a sign from the map.
sign_id | The sign to remove. |
Definition at line 56 of file ai_sign.cpp.
References CMD_RENAME_SIGN, AIObject::DoCommand(), EnforcePrecondition, and IsValidSign().