Public Member Functions | Public Attributes | List of all members
coord Class Reference
Inheritance diagram for coord:
city_x coord3d factory_x square_x map_object_x schedule_entry_x tile_object_list_x tile_x bridge_x building_x field_x label_x powerline_x sign_x tree_x tunnel_x way_x wayobj_x

Public Member Functions

string _tostring ()
 coord (int x, int y)
string href (string text)
coord operator* (integer fac)
coord operator+ (coord other)
coord operator- (coord other)
coord operator- ()
coord operator/ (integer fac)
dir to_dir ()

Public Attributes

integer x
integer y

Detailed Description

Class that holds 2d coordinates. All functions that use this as input parameters will accept every data structure that contains members x and y.

Coordinates always refer to the original rotation in map::file. They will be rotated if transferred between the game engine and squirrel.

Definition at line 32 of file

Member Function Documentation

◆ _tostring()

string coord::_tostring ( )

Converts coordinate to string containing the coordinates in the current rotation of the map.

Cannot be used in links in scenario texts. Use href instead.

◆ href()

string coord::href ( string  text)

Generates text to generate links to coordinates in scenario texts.

texttext to be shown in the link
a-tag with link in href
See also

◆ to_dir()

dir coord::to_dir ( )

Helper function to convert direction vector to dir type.

The documentation for this class was generated from the following file: