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

Public Member Functions

integer calc_revenue (way_types wt, integer speedkmh)
 
integer get_catg_index ()
 
integer get_weight_per_unit ()
 
 good_desc_x (string name)
 
bool is_interchangeable (good_desc_x)
 
- 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 mail
 descriptor for mail
 
static good_desc_x passenger
 descriptor for passenger
 

Detailed Description

Descriptor of goods and freight types.

Definition at line 396 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_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.


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