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

Public Types

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

Public Member Functions

bool can_be_built_aboveground ()
 
bool can_be_built_underground ()
 
bool enables_freight ()
 
bool enables_mail ()
 
bool enables_pax ()
 
integer get_capacity ()
 
integer get_cost ()
 
integer get_headquarter_level ()
 
integer get_maintenance ()
 
coord get_size (integer rotation)
 
building_desc_x::building_type get_type ()
 
way_types get_waytype ()
 
bool is_attraction ()
 
bool is_terminus ()
 
- 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< building_desc_xget_available_stations (building_desc_x::building_type type, way_types wt, good_desc_x freight)
 
static array< building_desc_xget_building_list (building_desc_x::building_type)
 

Detailed Description

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

Definition at line 163 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

city_res 

city building: residential

city_com 

city building: commercial

city_ind 

city building: industrial

Definition at line 208 of file api_obj_desc.cc.

Member Function Documentation

◆ can_be_built_aboveground()

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

◆ can_be_built_underground()

bool building_desc_x::can_be_built_underground ( )
Returns
whether station 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()

static 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 (can be wt_all to ignore waytype of desc)
freightstation should accept this freight (if equal to {}, i.e., empty table, then return all buildings)
Returns
the list

◆ get_building_list()

static 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: