Simutrans-Squirrel-API  r11919
Public Member Functions | Static Public Attributes | List of all members
good_desc_x Class Reference
Inheritance diagram for good_desc_x:
Inheritance graph
[legend]

Public Member Functions

 good_desc_x (string name)
 
integer get_catg_index ()
 
bool is_interchangeable (good_desc_x)
 
integer get_weight_per_unit ()
 
string get_metric ()
 
integer calc_revenue (way_types wt, integer speedkmh)
 
- Public Member Functions inherited from obj_desc_x
string get_name ()
 
bool is_equal (obj_desc_x other)
 
bool is_valid ()
 

Static Public Attributes

static good_desc_x passenger
 descriptor for passenger More...
 
static good_desc_x mail
 descriptor for mail More...
 

Detailed Description

Descriptor of goods and freight types.

Definition at line 407 of file api_obj_desc.cc.

Constructor & Destructor Documentation

◆ good_desc_x()

good_desc_x::good_desc_x ( string  name)

Constructor.

Parameters
nameraw name of the freight type.

Member Function Documentation

◆ calc_revenue()

integer good_desc_x::calc_revenue ( way_types  wt,
integer  speedkmh 
)

Calculates transport revenue per tile and freight unit. Takes speedbonus into account. Value contains an additional factor of 3000. Don't ask. Divide by 3000 after calculating revenue for a loaded convoy.

Parameters
wtwaytype of vehicle
speedkmhactual achieved speed in km/h
Returns
revenue

◆ get_catg_index()

integer good_desc_x::get_catg_index ( )
Returns
freight category. 0=Passengers, 1=Mail, 2=None, >=3 anything else

◆ get_metric()

string good_desc_x::get_metric ( )
Returns
metric unit name

◆ get_weight_per_unit()

integer good_desc_x::get_weight_per_unit ( )
Returns
weight of one unit of this freight

◆ is_interchangeable()

bool good_desc_x::is_interchangeable ( good_desc_x  )

Checks if this good can be interchanged with the other, in terms of transportability.

Member Data Documentation

◆ mail

good_desc_x good_desc_x::mail
static

descriptor for mail

Definition at line 415 of file api_obj_desc.cc.

◆ passenger

good_desc_x good_desc_x::passenger
static

descriptor for passenger

Definition at line 414 of file api_obj_desc.cc.


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