Simutrans-Squirrel-API
Classes | Functions
api_scenario.cc File Reference

Go to the source code of this file.

Classes

class  debug
 
class  rules
 

Functions

string coord3d_to_string (coord3d c)
 
string coord_to_string (coord c)
 
string difftick_to_string (integer)
 
string double_to_string (float value, integer decimals)
 
string get_month_name (integer month)
 
string integer_to_string (integer value)
 
string load_language_file (string file)
 
string money_to_string (integer value)
 
string translate (string text)
 

Detailed Description

exports scenario related functions.

Definition in file api_scenario.cc.

Function Documentation

◆ coord3d_to_string()

string coord3d_to_string ( coord3d  c)

Print coordinates, does automatic rotation.

Parameters
ccoordinate
Returns
a nice string

◆ coord_to_string()

string coord_to_string ( coord  c)

Print coordinates, does automatic rotation.

Parameters
ccoordinate
Returns
a nice string

◆ difftick_to_string()

string difftick_to_string ( integer  )

Translates difference of ticks to string.

◆ 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
valuenumber to print
decimalshow many decimals should be printed
Returns
a nice string

◆ get_month_name()

string get_month_name ( integer  month)

Get name of given month.

Parameters
monthnumber between 0 (january) and 11 (december)
Returns
month name in language of server

◆ integer_to_string()

string integer_to_string ( integer  value)

Pretty-print integers, use language specific separator for powers of thousands.

Parameters
valuenumber to print
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
valuenumber to print
Returns
a nice string with trailing dollar-sign

◆ translate()

string translate ( string  text)

Helper method to translate strings.

Parameters
textstring to translate
Returns
translation of given string