Simutrans-Squirrel-API
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 is_valid ()
 
string get_name ()
 
string set_name (string)
 
player_x get_owner ()
 
integer is_connected (halt_x halt, good_desc_x freight_type)
 
bool accepts_good (good_desc_x freight_type)
 
array< integer > get_arrived ()
 
array< integer > get_departed ()
 
array< integer > get_waiting ()
 
array< integer > get_happy ()
 
array< integer > get_unhappy ()
 
array< integer > get_noroute ()
 
array< integer > get_convoys ()
 
array< integer > get_walked ()
 
convoy_list_x get_convoy_list ()
 
line_list_x get_line_list ()
 
array< tile_xget_tile_list ()
 
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)
 
integer get_capacity (good_desc_x freight)
 

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

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
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
array<integer> halt_x::get_arrived ( )

Get monthly statistics of number of arrived goods.

Returns
array, index [0] corresponds to current month
integer halt_x::get_capacity ( good_desc_x  freight)

Returns capacity of this halt for the given freight

Parameters
freightfreight type
convoy_list_x halt_x::get_convoy_list ( )

Exports list of convoys that stop at this halt.

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
array<integer> halt_x::get_departed ( )

Get monthly statistics of number of departed goods.

Returns
array, index [0] corresponds to current month
array<factory_x> halt_x::get_factory_list ( )

Get list of factories connected to this station.

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
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
array<integer> halt_x::get_happy ( )

Get monthly statistics of number of happy passengers.

Returns
array, index [0] corresponds to current month
line_list_x halt_x::get_line_list ( )

Exports list of lines that serve this halt.

string halt_x::get_name ( )

Station name.

Returns
name
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
player_x halt_x::get_owner ( )

Station owner.

Returns
owner
array<tile_x> halt_x::get_tile_list ( )

Get list of tiles belonging to this station.

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
array<integer> halt_x::get_waiting ( )

Get monthly statistics of number of waiting goods.

Returns
array, index [0] corresponds to current month
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
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)
bool halt_x::is_valid ( )
Returns
if object is still valid.

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