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

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

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

◆ calc_max_speed()

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

◆ get_capacity()

array<integer> convoy_x::get_capacity ( )

Get monthly statistics of capacity.

Returns
array, index [0] corresponds to current month

◆ get_cost()

array<integer> convoy_x::get_cost ( )

Get monthly statistics of running costs.

Returns
array, index [0] corresponds to current month

◆ get_distance_traveled_total()

integer convoy_x::get_distance_traveled_total ( )
Returns
lifetime traveled distance of this convoy

◆ get_goods_catg_index()

array<integer> convoy_x::get_goods_catg_index ( )

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

Returns
array

◆ get_home_depot()

coord3d convoy_x::get_home_depot ( )
Returns
gets location of home depot

◆ get_line()

line_x convoy_x::get_line ( )
Returns
the line the convoy belongs to, null if there is no line

◆ get_loading_level()

integer convoy_x::get_loading_level ( )
Returns
get current loading level

◆ get_loading_limit()

integer convoy_x::get_loading_limit ( )
Returns
get current loading limit: waiting for full load gives 100

◆ get_name()

string convoy_x::get_name ( )

Name of convoy.

Returns
name

◆ get_owner()

player_x convoy_x::get_owner ( )

Owner of convoy.

Returns
owner, which is instance of player_x

◆ get_pos()

coord3d convoy_x::get_pos ( )

Position of convoy.

Returns
pos

◆ get_profit()

array<integer> convoy_x::get_profit ( )

Get monthly statistics of profit.

Returns
array, index [0] corresponds to current month

◆ get_revenue()

array<integer> convoy_x::get_revenue ( )

Get monthly statistics of revenue.

Returns
array, index [0] corresponds to current month

◆ get_schedule()

schedule_x convoy_x::get_schedule ( )

Schedule of this convoy.

◆ get_speed()

integer convoy_x::get_speed ( )
Returns
current speed of convoy

◆ get_tile_length()

integer convoy_x::get_tile_length ( )
Returns
returns the number of station tiles covered by the convoy.

◆ get_transported_goods()

array<integer> convoy_x::get_transported_goods ( )

Get monthly statistics of number of transported goods.

Returns
array, index [0] corresponds to current month

◆ get_traveled_distance()

array<integer> convoy_x::get_traveled_distance ( )

Get monthly statistics of traveled distance.

Returns
array, index [0] corresponds to current month

◆ get_vehicles()

array<vehicle_desc_x> convoy_x::get_vehicles ( )
Returns
returns an array containing the vehicle_desc_x 's of the vehicles of this convoy

◆ get_way_tolls()

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

◆ get_waytype()

way_types convoy_x::get_waytype ( )

Returns waytype of convoy.

Returns
waytype
See also
way_types

◆ has_obsolete_vehicles()

bool convoy_x::has_obsolete_vehicles ( )
Returns
whether convoi has obsolete vehicles

◆ is_in_depot()

bool convoy_x::is_in_depot ( )
Returns
true if convoy is in depot

◆ is_loading()

bool convoy_x::is_loading ( )
Returns
true if convoy is currently waiting (for way clearance)

◆ is_schedule_editor_open()

bool convoy_x::is_schedule_editor_open ( )
Returns
returns true if the schedule of the convoy is currently being edited.

◆ is_valid()

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

◆ is_waiting()

bool convoy_x::is_waiting ( )
Returns
true if convoy is currently waiting (for way clearance)

◆ is_withdrawn()

bool convoy_x::is_withdrawn ( )
Returns
the flag 'withdraw convoy'

◆ needs_electrification()

bool convoy_x::needs_electrification ( )

Does convoy needs electrified ways?

Returns
true if this is the case

◆ speed_to_tiles_per_month()

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: