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

Public Member Functions

bool is_valid ()
 
bool needs_electrification ()
 
string get_name ()
 
string set_name (string)
 
coord3d get_pos ()
 
player_x get_owner ()
 
array< integer > get_goods_catg_index ()
 
way_types get_waytype ()
 
schedule_x get_schedule ()
 
array< integer > get_capacity ()
 
array< integer > get_transported_goods ()
 
array< integer > get_revenue ()
 
array< integer > get_cost ()
 
array< integer > get_profit ()
 
array< integer > get_traveled_distance ()
 
array< integer > get_way_tolls ()
 
integer get_distance_traveled_total ()
 
line_x get_line ()
 
string set_line (player_x player, line_x line)
 
array< vehicle_desc_xget_vehicles ()
 
integer get_speed ()
 
integer get_loading_limit ()
 
integer get_loading_level ()
 
coord3d get_home_depot ()
 
bool has_obsolete_vehicles ()
 
string toggle_withdraw (player_x)
 
bool is_withdrawn ()
 
bool is_in_depot ()
 
string destroy (player_x)
 
bool is_schedule_editor_open ()
 

Static Public Member Functions

static integer calc_max_speed (integer power, integer weight, integer speed_limit)
 
static integer speed_to_tiles_per_month (integer speed)
 

Detailed Description

Class to access a convoy. Player vehicles are convoys, which themselves consist of individual vehicles (trucks, trailers, ...).

Definition at line 38 of file api_convoy.cc.

Member Function Documentation

static integer convoy_x::calc_max_speed ( integer  power,
integer  weight,
integer  speed_limit 
)
static

Static method to compute the potential max speed of a convoy with the given parameters.

Parameters
powertotal power of convoy
weightweight of convoy
speed_limitspeed limit induced by convoy's vehicles
Returns
max speed
array<integer> convoy_x::get_capacity ( )

Get monthly statistics of capacity.

Returns
array, index [0] corresponds to current month
array<integer> convoy_x::get_cost ( )

Get monthly statistics of running costs.

Returns
array, index [0] corresponds to current month
integer convoy_x::get_distance_traveled_total ( )
Returns
lifetime traveled distance of this convoy
array<integer> convoy_x::get_goods_catg_index ( )

Returns array of goods categories that can be transported by this convoy.

Returns
array
coord3d convoy_x::get_home_depot ( )
Returns
gets location of home depot
line_x convoy_x::get_line ( )
Returns
the line the convoy belongs to, null if there is no line
integer convoy_x::get_loading_level ( )
Returns
get current loading level
integer convoy_x::get_loading_limit ( )
Returns
get current loading limit: waiting for full load gives 100
string convoy_x::get_name ( )

Name of convoy.

Returns
name
player_x convoy_x::get_owner ( )

Owner of convoy.

Returns
owner, which is instance of player_x
coord3d convoy_x::get_pos ( )

Position of convoy.

Returns
pos
array<integer> convoy_x::get_profit ( )

Get monthly statistics of profit.

Returns
array, index [0] corresponds to current month
array<integer> convoy_x::get_revenue ( )

Get monthly statistics of revenue.

Returns
array, index [0] corresponds to current month
schedule_x convoy_x::get_schedule ( )

Schedule of this convoy.

integer convoy_x::get_speed ( )
Returns
current speed of convoy
array<integer> convoy_x::get_transported_goods ( )

Get monthly statistics of number of transported goods.

Returns
array, index [0] corresponds to current month
array<integer> convoy_x::get_traveled_distance ( )

Get monthly statistics of traveled distance.

Returns
array, index [0] corresponds to current month
array<vehicle_desc_x> convoy_x::get_vehicles ( )
Returns
returns an array containing the vehicle_desc_x 's of the vehicles of this convoy
array<integer> convoy_x::get_way_tolls ( )

Get monthly statistics of income/loss due to way tolls.

Returns
array, index [0] corresponds to current month
way_types convoy_x::get_waytype ( )

Returns waytype of convoy.

Returns
waytype
See also
way_types
bool convoy_x::has_obsolete_vehicles ( )
Returns
whether convoi has obsolete vehicles
bool convoy_x::is_in_depot ( )
Returns
true if convoy is in depot
bool convoy_x::is_schedule_editor_open ( )
Returns
returns true if the schedule of the convoy is currently being edited.
bool convoy_x::is_valid ( )
Returns
if object is still valid.
bool convoy_x::is_withdrawn ( )
Returns
the flag 'withdraw convoy'
bool convoy_x::needs_electrification ( )

Does convoy needs electrified ways?

Returns
true if this is the case
static integer convoy_x::speed_to_tiles_per_month ( integer  speed)
static

Static method to convert speed (from km per hour) to tiles per month.

Parameters
speed
Returns
tile per month

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