Simutrans-Squirrel-API  124.3 (r11590 on 11-Jan-2025)
Public Member Functions | List of all members
map_object_x Class Reference
Inheritance diagram for map_object_x:
Inheritance graph
[legend]

Public Member Functions

 map_object_x (integer x, integer y, integer z, map_objects type)
 
bool is_valid ()
 
player_x get_owner ()
 
string get_name ()
 
way_types get_waytype ()
 
coord3d get_pos ()
 
string is_removable (player_x)
 
map_objects get_type ()
 
void mark ()
 
void unmark ()
 
bool is_marked ()
 
- Public Member Functions inherited from coord3d
 coord (int x, int y, int z)
 
coord3d operator+ (coord3d other)
 
coord3d operator- (coord other)
 
coord3d operator+ (coord3d other)
 
coord3d operator- (coord other)
 
coord3d operator- ()
 
coord3d operator* (integer fac)
 
coord3d operator/ (integer fac)
 
string _tostring ()
 
string href (string text)
 
- Public Member Functions inherited from coord
 coord (int x, int y)
 
coord operator+ (coord other)
 
coord operator- (coord other)
 
coord operator- ()
 
coord operator* (integer fac)
 
coord operator/ (integer fac)
 
string _tostring ()
 
string href (string text)
 
dir to_dir ()
 

Additional Inherited Members

- Public Attributes inherited from coord3d
integer x
 x-coordinate More...
 
integer y
 y-coordinate More...
 
integer z
 z-coordinate - height More...
 
- Public Attributes inherited from coord
integer x
 x-coordinate More...
 
integer y
 y-coordinate More...
 

Detailed Description

Class to access objects on the map These classes cannot modify anything.

Definition at line 10 of file api_map_objects.cc.

Constructor & Destructor Documentation

◆ map_object_x()

map_object_x::map_object_x ( integer  x,
integer  y,
integer  z,
map_objects  type 
)

Constructor. Implemented by derived classes. Fails if no object of precisely the requested type is on the tile. If there is more than one object of this type on the tile then it will return the first.

Parameters
x
y
z
typeof the map object

Member Function Documentation

◆ get_name()

string map_object_x::get_name ( )
Returns
raw name.

◆ get_owner()

player_x map_object_x::get_owner ( )
Returns
owner of the object.

◆ get_pos()

coord3d map_object_x::get_pos ( )
Returns
position.

◆ get_type()

map_objects map_object_x::get_type ( )
Returns
type of object.

◆ get_waytype()

way_types map_object_x::get_waytype ( )
Returns
way type, can be wt_invalid.

◆ is_marked()

bool map_object_x::is_marked ( )
Returns
whether object is highlighted.

◆ is_removable()

string map_object_x::is_removable ( player_x  )

Checks whether player can remove this object.

Returns
error message or null if object can be removed.

◆ is_valid()

bool map_object_x::is_valid ( )
Returns
if object is still valid.

◆ mark()

void map_object_x::mark ( )

Marks the object for highlighting. Use with care.

◆ unmark()

void map_object_x::unmark ( )

Unmarks the object for highlighting.


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