Simutrans-Squirrel-API  124.3 (r11590 on 11-Jan-2025)
Enumerations
api_const.cc File Reference

Go to the source code of this file.

Enumerations

enum  tool_ids {
  tool_remover , tool_raise_land , tool_lower_land , tool_setslope ,
  tool_restoreslope , tool_set_marker , tool_clear_reservation , tool_build_transformer ,
  tool_add_city , tool_change_city_size , tool_plant_tree , tool_build_groundobj ,
  tool_build_way , tool_build_bridge , tool_build_tunnel , tool_remove_way ,
  tool_build_wayobj , tool_build_station , tool_build_roadsign , tool_build_depot ,
  tool_build_house , tool_land_chain , tool_city_chain , tool_build_factory ,
  tool_link_factory , tool_headquarter , tool_lock_game , tool_add_citycar ,
  tool_forest , tool_stop_mover , tool_make_stop_public , tool_remove_wayobj ,
  tool_buy_house , tool_build_cityroad , tool_change_water_height , tool_set_climate ,
  tool_rotate_building , tool_merge_stop , tool_exec_script , tool_exec_two_click_script ,
  tool_set_owner , tool_increase_industry , tool_switch_player , tool_step_year ,
  tool_fill_trees , tool_set_traffic_level , dialog_edit_factory , dialog_edit_attraction ,
  dialog_edit_house , dialog_edit_tree , dialog_enlarge_map
}
 
enum  tool_flags { shift_pressed , ctrl_pressed }
 
enum  way_types {
  wt_all , wt_road , wt_rail , wt_water ,
  wt_monorail , wt_maglev , wt_tram , wt_narrowgauge ,
  wt_air , wt_power , wt_decoration , wt_invalid
}
 
enum  way_system_types { st_flat , st_elevated , st_runway , st_tram }
 
enum  { player_all }
 
enum  map_objects {
  mo_tree , mo_pointer , mo_cloud , mo_building ,
  mo_signal , mo_bridge , mo_tunnel , mo_depot_rail ,
  mo_depot_road , mo_depot_water , mo_powerline , mo_transformer_s ,
  mo_transformer_c , mo_roadsign , mo_pillar , mo_depot_air ,
  mo_depot_monorail , mo_depot_tram , mo_depot_maglev , mo_wayobj ,
  mo_way , mo_label , mo_field , mo_crossing ,
  mo_groundobj , mo_depot_narrowgauge , mo_pedestrian , mo_city_car ,
  mo_car , mo_train , mo_monorail , mo_maglev ,
  mo_narrowgauge , mo_ship , mo_airplane , mo_moving_object
}
 
enum  units { CARUNITS_PER_TILE }
 
enum  climates {
  cl_water , cl_desert , cl_tropic , cl_mediterran ,
  cl_temperate , cl_tundra , cl_rocky , cl_arctic
}
 

Detailed Description

exports constants

Definition in file api_const.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
player_all 

constant to forbid/allow tools for all players (except public player)

Definition at line 160 of file api_const.cc.

◆ climates

enum climates

Climate zones. Their naming may differ from the graphical representation and translation in some paksets.

Enumerator
cl_water 
cl_desert 
cl_tropic 
cl_mediterran 
cl_temperate 
cl_tundra 
cl_rocky 
cl_arctic 

Definition at line 252 of file api_const.cc.

◆ map_objects

Types of map objects.

Enumerator
mo_tree 

tree

mo_pointer 

pointer (bulldozers etc)

mo_cloud 

cloud and smoke

mo_building 

building (houses, halts, factories ...)

mo_signal 

signal

mo_bridge 

bridge

mo_tunnel 

tunnel

mo_depot_rail 

depot: rail

mo_depot_road 

depot: road

mo_depot_water 

depot: ship

mo_powerline 

powerline

mo_transformer_s 

transformer at powerplant

mo_transformer_c 

transformer at factory

mo_roadsign 

road-sign

mo_pillar 

bridge pillar

mo_depot_air 

depot: airplanes

mo_depot_monorail 

depot: monorail

mo_depot_tram 

depot: tram

mo_depot_maglev 

depot: maglev

mo_wayobj 

way object (overhead wires)

mo_way 

way

mo_label 

text label

mo_field 

field

mo_crossing 

crossing

mo_groundobj 

decorative objects (rocks, lakes ...)

mo_depot_narrowgauge 

depot: narrowgauge

mo_pedestrian 

pedestrian

mo_city_car 

city car - not player owned

mo_car 

road vehicle

mo_train 

rail vehicle

mo_monorail 

monorail vehicle

mo_maglev 

maglev vehicle

mo_narrowgauge 

narrowgauge vehicle

mo_ship 

ship

mo_airplane 

airplane

mo_moving_object 

moving object (sheep ...)

Definition at line 167 of file api_const.cc.

◆ tool_flags

enum tool_flags

Flags for scripted tools.

Enumerator
shift_pressed 
ctrl_pressed 

Definition at line 113 of file api_const.cc.

◆ tool_ids

enum tool_ids

Constants to identify tools, ie actions a player can perform to alter the state of the game.

Enumerator
tool_remover 

remover tool

tool_raise_land 

raise land tool

tool_lower_land 

lower land tool

tool_setslope 

artificial slope

tool_restoreslope 

restore natural slope

tool_set_marker 

set marker

tool_clear_reservation 

clear block reservation

tool_build_transformer 

build transformer

tool_add_city 

add city

tool_change_city_size 

change city size

tool_plant_tree 

plant a tree

tool_build_groundobj 

build groundobj/movingobj

tool_build_way 

build ways

tool_build_bridge 

build bridges

tool_build_tunnel 

build tunnel

tool_remove_way 

remove way

tool_build_wayobj 

build overhead wires

tool_build_station 

build stations

tool_build_roadsign 

build signals and road signs

tool_build_depot 

build depot

tool_build_house 

build city houses

tool_land_chain 

create industry chain with end consumer not in cities

tool_city_chain 

create industry chain with end consumer in cities

tool_build_factory 

build a factory

tool_link_factory 

link factories

tool_headquarter 

build headquarters

tool_lock_game 

lock map: switching players not allowed anymore

tool_add_citycar 

add city car

tool_forest 

create forest

tool_stop_mover 

move stop tool

tool_make_stop_public 

make stop public

tool_remove_wayobj 

remove way objects like overheadwires

tool_buy_house 

buy a house

tool_build_cityroad 

build city road with pavement

tool_change_water_height 

alter water height

tool_set_climate 

change climate of tiles

tool_rotate_building 

rotate a building

tool_merge_stop 

merge two stops

tool_exec_script 

scripted tool (one-click)

tool_exec_two_click_script 

scripted tool (two-click)

tool_set_owner 

change owner of nth object on tile

tool_increase_industry 

increase industry density

tool_switch_player 

switch player

tool_step_year 

step year forward

tool_fill_trees 

fill area with trees

tool_set_traffic_level 

set traffic level

dialog_edit_factory 

open factory editor window

dialog_edit_attraction 

open tourist attraction editor window

dialog_edit_house 

open house editor window

dialog_edit_tree 

open tree editor window

dialog_enlarge_map 

open map enlargement window

Definition at line 6 of file api_const.cc.

22 {
27  begin_enum("tool_ids");
29  enum_slot(vm, "tool_remover", TOOL_REMOVER | GENERAL_TOOL);
31  enum_slot(vm, "tool_raise_land", TOOL_RAISE_LAND | GENERAL_TOOL);
33  enum_slot(vm, "tool_lower_land", TOOL_LOWER_LAND | GENERAL_TOOL);
35  enum_slot(vm, "tool_setslope", TOOL_SETSLOPE | GENERAL_TOOL);
37  enum_slot(vm, "tool_restoreslope", TOOL_RESTORESLOPE | GENERAL_TOOL);
39  enum_slot(vm, "tool_set_marker", TOOL_MARKER | GENERAL_TOOL);
41  enum_slot(vm, "tool_clear_reservation", TOOL_CLEAR_RESERVATION | GENERAL_TOOL);
43  enum_slot(vm, "tool_build_transformer", TOOL_TRANSFORMER | GENERAL_TOOL);
45  enum_slot(vm, "tool_add_city", TOOL_ADD_CITY | GENERAL_TOOL);
47  enum_slot(vm, "tool_change_city_size", TOOL_CHANGE_CITY_SIZE | GENERAL_TOOL);
49  enum_slot(vm, "tool_plant_tree", TOOL_PLANT_TREE | GENERAL_TOOL);
50  // not needed? enum__slot(vm, "tool_schedule_add", TOOL_SCHEDULE_ADD | GENERAL_TOOL);
51  // not needed? enum__slot(vm, "tool_schedule_ins", TOOL_SCHEDULE_INS | GENERAL_TOOL);
53  enum_slot(vm, "tool_build_groundobj", TOOL_PLANT_GROUNDOBJ | GENERAL_TOOL);
55  enum_slot(vm, "tool_build_way", TOOL_BUILD_WAY | GENERAL_TOOL);
57  enum_slot(vm, "tool_build_bridge", TOOL_BUILD_BRIDGE | GENERAL_TOOL);
59  enum_slot(vm, "tool_build_tunnel", TOOL_BUILD_TUNNEL | GENERAL_TOOL);
61  enum_slot(vm, "tool_remove_way", TOOL_WAYREMOVER | GENERAL_TOOL);
63  enum_slot(vm, "tool_build_wayobj", TOOL_BUILD_WAYOBJ | GENERAL_TOOL);
65  enum_slot(vm, "tool_build_station", TOOL_BUILD_STATION | GENERAL_TOOL);
67  enum_slot(vm, "tool_build_roadsign", TOOL_BUILD_ROADSIGN | GENERAL_TOOL);
69  enum_slot(vm, "tool_build_depot", TOOL_BUILD_DEPOT | GENERAL_TOOL);
71  enum_slot(vm, "tool_build_house", TOOL_BUILD_HOUSE | GENERAL_TOOL);
73  enum_slot(vm, "tool_land_chain", TOOL_BUILD_LAND_CHAIN | GENERAL_TOOL);
75  enum_slot(vm, "tool_city_chain", TOOL_CITY_CHAIN | GENERAL_TOOL);
77  enum_slot(vm, "tool_build_factory", TOOL_BUILD_FACTORY | GENERAL_TOOL);
79  enum_slot(vm, "tool_link_factory", TOOL_LINK_FACTORY | GENERAL_TOOL);
81  enum_slot(vm, "tool_headquarter", TOOL_HEADQUARTER | GENERAL_TOOL);
83  enum_slot(vm, "tool_lock_game", TOOL_LOCK_GAME | GENERAL_TOOL);
85  enum_slot(vm, "tool_add_citycar", TOOL_ADD_CITYCAR | GENERAL_TOOL);
87  enum_slot(vm, "tool_forest", TOOL_FOREST | GENERAL_TOOL);
89  enum_slot(vm, "tool_stop_mover", TOOL_STOP_MOVER | GENERAL_TOOL);
91  enum_slot(vm, "tool_make_stop_public", TOOL_MAKE_STOP_PUBLIC | GENERAL_TOOL);
93  enum_slot(vm, "tool_remove_wayobj", TOOL_REMOVE_WAYOBJ | GENERAL_TOOL);
94  // not needed? enum__slot(vm, "tool_sliced_and_underground_view", TOOL_SLICED_AND_UNDERGROUND_VIEW | GENERAL_TOOL);
96  enum_slot(vm, "tool_buy_house", TOOL_BUY_HOUSE | GENERAL_TOOL);
98  enum_slot(vm, "tool_build_cityroad", TOOL_BUILD_CITYROAD | GENERAL_TOOL);
100  enum_slot(vm, "tool_change_water_height", TOOL_CHANGE_WATER_HEIGHT | GENERAL_TOOL);
102  enum_slot(vm, "tool_set_climate", TOOL_SET_CLIMATE | GENERAL_TOOL);
104  enum_slot(vm, "tool_rotate_building", TOOL_ROTATE_BUILDING | GENERAL_TOOL);
106  enum_slot(vm, "tool_merge_stop", TOOL_MERGE_STOP | GENERAL_TOOL);
108  enum_slot(vm, "tool_exec_script", TOOL_EXEC_SCRIPT | GENERAL_TOOL);

◆ units

enum units

Internal units.

Enumerator
CARUNITS_PER_TILE 

The length of one side of a tile in car units.

See also
vehicle_desc_x::get_length

Definition at line 244 of file api_const.cc.

◆ way_system_types

Constants for different system types of ways. System type could take also other values than the ones defined here.

Enumerator
st_flat 

flat ways

st_elevated 

elevated ways

st_runway 

runway (for wt_air), equal to st_elevated

st_tram 

tram tracks (here way type has to be wt_tram)

Definition at line 150 of file api_const.cc.

◆ way_types

enum way_types

Constants for different way types.

Enumerator
wt_all 

catch all value: used to forbid tools for all waytypes

wt_road 

road

wt_rail 

rail

wt_water 

water

wt_monorail 

monorail

wt_maglev 

maglev

wt_tram 

trams

wt_narrowgauge 

narrow gauge

wt_air 

aircrafts and airports

wt_power 

powerlines

wt_decoration 

decomartion for unspecifed wayobj

wt_invalid 

invalid

Definition at line 120 of file api_const.cc.