Go to the source code of this file.
exports scenario related functions.
Definition in file api_scenario.cc.
◆ coord3d_to_string()
| string coord3d_to_string |
( |
coord3d |
c | ) |
|
Print coordinates, does automatic rotation.
- Parameters
-
- Returns
- a nice string
◆ coord_to_string()
| string coord_to_string |
( |
coord |
c | ) |
|
Print coordinates, does automatic rotation.
- Parameters
-
- Returns
- a nice string
◆ difftick_to_string()
| string difftick_to_string |
( |
integer |
difftick_to_string_intern | ) |
|
Translates difference of ticks to string which could even have months in it.
- Parameters
-
| difftick_to_string_intern | ticks in simutrans units |
- Returns
- time difference using the current local setting
◆ double_to_string()
| string double_to_string |
( |
float |
value, |
|
|
integer |
decimals |
|
) |
| |
Pretty-print floating point numbers, use language specific separator for powers of thousands.
- Parameters
-
| value | number to print |
| decimals | how many decimals should be printed |
- Returns
- a nice string
◆ get_month_name()
| string get_month_name |
( |
integer |
month | ) |
|
Get name of given month.
- Parameters
-
| month | number between 0 (january) and 11 (december) |
- Returns
- month name in language of server
◆ get_tool_key()
| void get_tool_key |
( |
any_x |
tool_id | ) |
|
Gets the tool_key (shortcut key) associated with a general tool by its ID. The ID corresponds to the index used in menuconf.tab (e.g. 0 = query tool, 1 = remover, etc.). Returns the hotkey as a string (e.g. "r", "M", "COMMA, "^s, "+F10", "#1234") without quotation marks or an empty string if there is no hotkey or invalid ID.
- Parameters
-
| tool_id | the numeric ID of the general tool (as defined in menuconf.tab) |
- Returns
- a string representing the hotkey, or empty if none or invalid
◆ integer_to_string()
| string integer_to_string |
( |
integer |
value | ) |
|
Pretty-print integers, use language specific separator for powers of thousands.
- Parameters
-
- Returns
- a nice string
◆ money_to_string()
| string money_to_string |
( |
integer |
value | ) |
|
Pretty-print money values, use language specific separator for powers of thousands.
- Parameters
-
- Returns
- a nice string with trailing dollar-sign
◆ translate()
| string translate |
( |
string |
text | ) |
|
Helper method to translate strings, needed to identify the correct overloaded function
- Parameters
-
- Returns
- translation of given string