Simutrans-Squirrel-API
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
halt_x Class Reference
Inheritance diagram for halt_x:
extend_get ingame_object

Public Member Functions

bool accepts_good (good_desc_x freight_type)
 
array< integer > get_arrived ()
 
integer get_capacity (good_desc_x freight)
 
array< halt_xget_connections (good_desc_x freight)
 
convoy_list_x get_convoy_list ()
 
array< integer > get_convoys ()
 
array< integer > get_departed ()
 
array< factory_xget_factory_list ()
 
integer get_freight_to_dest (good_desc_x freight, coord target)
 
integer get_freight_to_halt (good_desc_x freight, halt_x stop)
 
array< integer > get_happy ()
 
line_list_x get_line_list ()
 
string get_name ()
 
array< integer > get_noroute ()
 
player_x get_owner ()
 
array< tile_xget_tile_list ()
 
array< integer > get_unhappy ()
 
array< integer > get_waiting ()
 
array< integer > get_walked ()
 
integer is_connected (halt_x halt, good_desc_x freight_type)
 
bool is_valid ()
 
void set_name (string)
 

Static Public Member Functions

static halt_x get_halt (coord3d pos, player_x pl)
 

Private Member Functions

integer _cmp (halt_x halt)
 

Detailed Description

Class to access halts / stations / bus stops.

Definition at line 31 of file api_halt.cc.

Member Function Documentation

◆ _cmp()

integer halt_x::_cmp ( halt_x  halt)
private

compare classes using metamethods

Parameters
haltthe other halt
Returns
difference in the unique id of the halthandle

◆ accepts_good()

bool halt_x::accepts_good ( good_desc_x  freight_type)

Does this station accept this type of good?

Parameters
freight_typefreight type
Returns
the answer to this question

◆ get_arrived()

array<integer> halt_x::get_arrived ( )

Get monthly statistics of number of arrived goods.

Returns
array, index [0] corresponds to current month

◆ get_capacity()

integer halt_x::get_capacity ( good_desc_x  freight)

Returns capacity of this halt for the given freight

Parameters
freightfreight type

◆ get_connections()

array<halt_x> halt_x::get_connections ( good_desc_x  freight)

Returns list of connected halts for the specific freight type.

Parameters
freightfreight type

◆ get_convoy_list()

convoy_list_x halt_x::get_convoy_list ( )

Exports list of convoys that stop at this halt.

◆ get_convoys()

array<integer> halt_x::get_convoys ( )

Get monthly statistics of number of convoys that stopped at this station.

Returns
array, index [0] corresponds to current month

◆ get_departed()

array<integer> halt_x::get_departed ( )

Get monthly statistics of number of departed goods.

Returns
array, index [0] corresponds to current month

◆ get_factory_list()

array<factory_x> halt_x::get_factory_list ( )

Get list of factories connected to this station.

◆ get_freight_to_dest()

integer halt_x::get_freight_to_dest ( good_desc_x  freight,
coord  target 
)

Returns amount of freight at this halt that is going to target

Parameters
freightfreight type
targetcoordinate of target

◆ get_freight_to_halt()

integer halt_x::get_freight_to_halt ( good_desc_x  freight,
halt_x  stop 
)

Returns amount of freight at this halt that scheduled to stop

Parameters
freightfreight type
stopnext transfer stop

◆ get_halt()

static halt_x halt_x::get_halt ( coord3d  pos,
player_x  pl 
)
static

Returns halt at given position.

Parameters
poscoordinate
plplayer that wants to use halt here
Returns
halt instance

◆ get_happy()

array<integer> halt_x::get_happy ( )

Get monthly statistics of number of happy passengers.

Returns
array, index [0] corresponds to current month

◆ get_line_list()

line_list_x halt_x::get_line_list ( )

Exports list of lines that serve this halt.

◆ get_name()

string halt_x::get_name ( )

Station name.

Returns
name

◆ get_noroute()

array<integer> halt_x::get_noroute ( )

Get monthly statistics of number of passengers with no-route.

These passengers could not start their journey as they find no route to their destination.

Returns
array, index [0] corresponds to current month

◆ get_owner()

player_x halt_x::get_owner ( )

Station owner.

Returns
owner

◆ get_tile_list()

array<tile_x> halt_x::get_tile_list ( )

Get list of tiles belonging to this station.

◆ get_unhappy()

array<integer> halt_x::get_unhappy ( )

Get monthly statistics of number of unhappy passengers.

These passengers could not start their journey as station was crowded.

Returns
array, index [0] corresponds to current month

◆ get_waiting()

array<integer> halt_x::get_waiting ( )

Get monthly statistics of number of waiting goods.

Returns
array, index [0] corresponds to current month

◆ get_walked()

array<integer> halt_x::get_walked ( )

Get monthly statistics of number of passengers that could walk to their destination.

Returns
array, index [0] corresponds to current month

◆ is_connected()

integer halt_x::is_connected ( halt_x  halt,
good_desc_x  freight_type 
)

Quick check if there is connection for certain freight to the other halt.

Parameters
haltthe other halt
freight_typefreight type
Returns
0 - not connected, 1 - connected, -1 - undecided (call this method again later)

◆ is_valid()

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

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