Simutrans-Squirrel-API OTRP v63_4
Loading...
Searching...
No Matches
building_desc_x Class Reference
Inheritance diagram for building_desc_x:
Collaboration diagram for building_desc_x:

Public Types

enum  building_type {
  attraction_city , attraction_land , monument , factory ,
  townhall , headquarter , harbour , flat_harbour ,
  depot , station , station_extension
}
 building types More...

Public Member Functions

bool is_attraction ()
coord get_size (integer rotation)
integer get_maintenance ()
integer get_cost ()
integer get_capacity ()
bool can_be_built_underground ()
bool can_be_built_aboveground ()
bool enables_pax ()
bool enables_mail ()
bool enables_freight ()
building_desc_x::building_type get_type ()
way_types get_waytype ()
integer get_headquarter_level ()
bool is_terminus ()
Public Member Functions inherited from obj_desc_time_x
time_x get_intro_date ()
time_x get_retire_date ()
bool is_future (time_x time)
bool is_retired (time_x time)
bool is_available (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< building_desc_x > get_building_list (building_desc_x::building_type)
static array< building_desc_x > get_available_stations (building_desc_x::building_type type, way_types wt, good_desc_x freight)

Detailed Description

Object descriptors for buildings: houses, attractions, stations and extensions, depots, harbours.

Definition at line 158 of file api_obj_desc.cc.

Member Enumeration Documentation

◆ building_type

building types

Enumerator
attraction_city 

tourist attraction to be built in cities

attraction_land 

tourist attraction to be built outside cities

monument 

monument, built only once per map

factory 

factory

townhall 

townhall

headquarter 

company headquarters

harbour 

harbour

flat_harbour 

harbour without a slope (buildable on flat ground beaches)

depot 

depot

station 

station

station_extension 

station extension

Definition at line 203 of file api_obj_desc.cc.

Member Function Documentation

◆ can_be_built_aboveground()

bool building_desc_x::can_be_built_aboveground ( )
Returns
whether building can be built above ground

◆ can_be_built_underground()

bool building_desc_x::can_be_built_underground ( )
Returns
whether building can be built underground

◆ enables_freight()

bool building_desc_x::enables_freight ( )
Returns
whether this station building can handle freight

◆ enables_mail()

bool building_desc_x::enables_mail ( )
Returns
whether this station building can handle mail

◆ enables_pax()

bool building_desc_x::enables_pax ( )
Returns
whether this station building can handle passengers

◆ get_available_stations()

array< building_desc_x > building_desc_x::get_available_stations ( building_desc_x::building_type type,
way_types wt,
good_desc_x freight )
static

Returns an array of available station/extension/depot buildings. Entries are of type building_desc_x.

Parameters
typebuilding type from building_desc_x::building_type
wtwaytype
freightstation should accept this freight (if null then return all buildings)
Returns
the list

◆ get_building_list()

array< building_desc_x > building_desc_x::get_building_list ( building_desc_x::building_type )
static

Returns an array with all buildings of the given type.

Warning
If type is one of building_desc_x::harbour, building_desc_x::depot, building_desc_x::station, building_desc_x::station_extension then always the same list is generated. You have to filter out e.g. station buildings yourself.

◆ get_capacity()

integer building_desc_x::get_capacity ( )
Returns
capacity

◆ get_cost()

integer building_desc_x::get_cost ( )

Price to build this building, takes size, level, and type into account.

Returns
price [in 1/100 credits] to build this building

◆ get_headquarter_level()

integer building_desc_x::get_headquarter_level ( )
Returns
headquarter level (or -1 if building is not headquarter)

◆ get_maintenance()

integer building_desc_x::get_maintenance ( )
Returns
monthly maintenance cost

◆ get_size()

coord building_desc_x::get_size ( integer rotation)
Parameters
rotation
Returns
size of building in the given rotation

◆ get_type()

building_desc_x::building_type building_desc_x::get_type ( )
Returns
building type

◆ get_waytype()

way_types building_desc_x::get_waytype ( )
Returns
way type, can be wt_invalid.

◆ is_attraction()

bool building_desc_x::is_attraction ( )
Returns
whether building is an attraction

◆ is_terminus()

bool building_desc_x::is_terminus ( )
Returns
true if this is a station building that can be used as terminus

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