Simutrans-Squirrel-API
Public Member Functions | Static Public Member Functions | List of all members
vehicle_desc_x Class Reference
Inheritance diagram for vehicle_desc_x:
obj_desc_transport_x obj_desc_time_x obj_desc_x extend_get

Public Member Functions

bool can_be_first ()
 
bool can_be_last ()
 
integer get_capacity ()
 
good_desc_x get_freight ()
 
integer get_length ()
 
integer get_maintenance ()
 
integer get_power ()
 
array< vehicle_desc_xget_predecessors ()
 
integer get_running_cost ()
 
array< vehicle_desc_xget_successors ()
 
integer get_weight ()
 
bool needs_electrification ()
 
- Public Member Functions inherited from obj_desc_transport_x
integer get_cost ()
 
integer get_maintenance ()
 
integer get_topspeed ()
 
way_types get_waytype ()
 
- Public Member Functions inherited from obj_desc_time_x
time_x get_intro_date ()
 
time_x get_retire_date ()
 
bool is_available (time_x time)
 
bool is_future (time_x time)
 
bool is_retired (time_x time)
 
- Public Member Functions inherited from obj_desc_x
string get_name ()
 
bool is_equal (obj_desc_x other)
 
bool is_valid ()
 

Static Public Member Functions

static array< vehicle_desc_xget_available_vehicles (way_types)
 
static bool is_coupling_allowed (vehicle_desc_x first, vehicle_desc_x second)
 

Detailed Description

Vehicle descriptors

Definition at line 85 of file api_obj_desc.cc.

Member Function Documentation

◆ can_be_first()

bool vehicle_desc_x::can_be_first ( )
Returns
true if this vehicle can lead a convoy

◆ can_be_last()

bool vehicle_desc_x::can_be_last ( )
Returns
true if this vehicle can be the last of a convoy

◆ get_available_vehicles()

static array<vehicle_desc_x> vehicle_desc_x::get_available_vehicles ( way_types  )
static
Returns
a list of all available vehicles at the current in-game-time

◆ get_capacity()

integer vehicle_desc_x::get_capacity ( )
Returns
capacity

◆ get_freight()

good_desc_x vehicle_desc_x::get_freight ( )
Returns
freight that can be transported (or null)

◆ get_length()

integer vehicle_desc_x::get_length ( )
Returns
lengths in units::CARUNITS_PER_TILE

◆ get_maintenance()

integer vehicle_desc_x::get_maintenance ( )
Returns
fixed cost in 1/100 credits per month

◆ get_power()

integer vehicle_desc_x::get_power ( )

Power of the vehicle. This value can be used in convoy_x::calc_max_speed. It returns (power of vehicle in kW) * (gear value) * 64, where power and gear are as shown in-game.

Returns
the total power of the vehicle (takes power and gear from pak-files into account)

◆ get_predecessors()

array<vehicle_desc_x> vehicle_desc_x::get_predecessors ( )
Returns
list of possible predecessors, if list is empty then all are allowed (if can_be_first returns true, or no predecessors are allowed if can_be_first is false).

◆ get_running_cost()

integer vehicle_desc_x::get_running_cost ( )
Returns
running cost in 1/100 credits per tile

◆ get_successors()

array<vehicle_desc_x> vehicle_desc_x::get_successors ( )
Returns
list of possible successors, if list is empty then all are allowed (if can_be_last returns true, or no successors are allowed if can_be_last is false).

◆ get_weight()

integer vehicle_desc_x::get_weight ( )
Returns
weight of the empty vehicle

◆ is_coupling_allowed()

static bool vehicle_desc_x::is_coupling_allowed ( vehicle_desc_x  first,
vehicle_desc_x  second 
)
static

Checks if the coupling of first and second is possible in this order.

Parameters
first
second
Returns
true if coupling is possible

◆ needs_electrification()

bool vehicle_desc_x::needs_electrification ( )
Returns
true if this vehicle needs electrification (and is powered)

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