OpenTTD Source: RoadTypeInfo Class Reference

OpenTTD Source 15.3

Public Member Functions | Data Fields
RoadTypeInfo Class Reference

## Public Member Functions
bool | UsesOverlay () const
RoadType | Index () const
| Get the RoadType for this RoadTypeInfo.

## Data Fields
struct { |
SpriteID build_x_road |
| button for building single rail in X direction More...
SpriteID build_y_road |
| button for building single rail in Y direction More...
SpriteID auto_road |
| button for the autoroad construction More...
SpriteID build_depot |
| button for building depots More...
SpriteID build_tunnel |
| button for building a tunnel More...
SpriteID convert_road |
| button for converting road types More...
} | gui_sprites |
| struct containing the sprites for the road GUI.
struct { |
CursorID road_swne |
| Cursor for building rail in X direction. More...
CursorID road_nwse |
| Cursor for building rail in Y direction. More...
CursorID autoroad |
| Cursor for autorail tool. More...
CursorID depot |
| Cursor for building a depot. More...
CursorID tunnel |
| Cursor for building a tunnel. More...
SpriteID convert_road |
| Cursor for converting road types. More...
} | cursor |
| Cursors associated with the road type.
struct { |
StringID name |
| Name of this rail type. More...
StringID toolbar_caption |
| Caption in the construction toolbar GUI for this rail type. More...
StringID menu_text |
| Name of this rail type in the main toolbar dropdown. More...
StringID build_caption |
| Caption of the build vehicle GUI for this rail type. More...
StringID replace_text |
| Text used in the autoreplace GUI. More...
StringID new_engine |
| Name of an engine for this type of road in the engine preview GUI. More...
StringID err_build_road |
| Building a normal piece of road. More...
StringID err_remove_road |
| Removing a normal piece of road. More...
StringID err_depot |
| Building a depot. More...
StringID err_build_station [2] |
| Building a bus or truck station. More...
StringID err_remove_station [2] |
| Removing of a bus or truck station. More...
StringID err_convert_road |
| Converting a road type. More...
StringID picker_title [2] |
| Title for the station picker for bus or truck stations. More...
StringID picker_tooltip [2] |
| Tooltip for the station picker for bus or truck stations. More...
} | strings |
| Strings associated with the rail type.
RoadTypes | powered_roadtypes
| bitmask to the OTHER roadtypes on which a vehicle of THIS roadtype generates power
RoadTypeFlags | flags
| Bit mask of road type flags.
uint16_t | cost_multiplier
| Cost multiplier for building this road type.
uint16_t | maintenance_multiplier
| Cost multiplier for maintenance of this road type.
uint16_t | max_speed
| Maximum speed for vehicles travelling on this road type.
RoadTypeLabel | label
| Unique 32 bit road type identifier.
FlatSet< RoadTypeLabel > | alternate_labels
| Road type labels this type provides in addition to the main label.
PixelColour | map_colour
| Colour on mini-map.
TimerGameCalendar::Date | introduction_date
| Introduction date.
RoadTypes | introduction_required_roadtypes
| Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_date.
RoadTypes | introduces_roadtypes
| Bitmask of which other roadtypes are introduced when this roadtype is introduced.
uint8_t | sorting_order
| The sorting order of this roadtype for the toolbar dropdown.
const GRFFile * | grffile [ROTSG_END]
| NewGRF providing the Action3 for the roadtype.
const SpriteGroup * | group [ROTSG_END]
| Sprite groups for resolving sprites.
std::vector< BadgeID > | badges

## Detailed Description

Definition at line 52 of file road.h.

## Member Function Documentation

## ◆ Index()

RoadType RoadTypeInfo::Index | ( |  | ) | const

Get the RoadType for this RoadTypeInfo.

Returns
  RoadType in static RoadTypeInfo definitions.

Definition at line 30 of file road.cpp.

References ROADTYPE_END.

Referenced by AllocateRoadType(), RoadTypeScopeResolver::GetVariable(), and InitRoadTypes().

## ◆ UsesOverlay()

bool RoadTypeInfo::UsesOverlay | ( |  | ) | const
| inline

Definition at line 170 of file road.h.

## Field Documentation

## ◆ alternate_labels

FlatSet<RoadTypeLabel> RoadTypeInfo::alternate_labels

Road type labels this type provides in addition to the main label.

Definition at line 126 of file road.h.

Referenced by AllocateRoadType(), and GetRoadTypeByLabel().

## ◆ auto_road

SpriteID RoadTypeInfo::auto_road

button for the autoroad construction

Definition at line 61 of file road.h.

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ autoroad

CursorID RoadTypeInfo::autoroad

Cursor for autorail tool.

Definition at line 70 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick().

## ◆ badges

std::vector<BadgeID> RoadTypeInfo::badges

Definition at line 168 of file road.h.

## ◆ build_caption

StringID RoadTypeInfo::build_caption

Caption of the build vehicle GUI for this rail type.

Definition at line 80 of file road.h.

Referenced by BuildVehicleWindow::GetWidgetString(), and RoadTypeChangeInfo().

## ◆ build_depot

SpriteID RoadTypeInfo::build_depot

button for building depots

Definition at line 62 of file road.h.

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ build_tunnel

SpriteID RoadTypeInfo::build_tunnel

button for building a tunnel

Definition at line 63 of file road.h.

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ build_x_road

SpriteID RoadTypeInfo::build_x_road

button for building single rail in X direction

Definition at line 59 of file road.h.

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ build_y_road

SpriteID RoadTypeInfo::build_y_road

button for building single rail in Y direction

Definition at line 60 of file road.h.

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ convert_road

SpriteID RoadTypeInfo::convert_road

button for converting road types

Cursor for converting road types.

Definition at line 64 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick(), and BuildRoadToolbarWindow::OnInit().

## ◆ cost_multiplier

uint16_t RoadTypeInfo::cost_multiplier

Cost multiplier for building this road type.

Definition at line 106 of file road.h.

Referenced by RoadTypeChangeInfo().

## ◆ depot

CursorID RoadTypeInfo::depot

Cursor for building a depot.

Definition at line 71 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick().

## ◆ err_build_road

StringID RoadTypeInfo::err_build_road

Building a normal piece of road.

Definition at line 84 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp().

## ◆ err_build_station

StringID RoadTypeInfo::err_build_station[2]

Building a bus or truck station.

Definition at line 87 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp().

## ◆ err_convert_road

StringID RoadTypeInfo::err_convert_road

Converting a road type.

Definition at line 89 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp().

## ◆ err_depot

StringID RoadTypeInfo::err_depot

Building a depot.

Definition at line 86 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceObject().

## ◆ err_remove_road

StringID RoadTypeInfo::err_remove_road

Removing a normal piece of road.

Definition at line 85 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp().

## ◆ err_remove_station

StringID RoadTypeInfo::err_remove_station[2]

Removing of a bus or truck station.

Definition at line 88 of file road.h.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp().

## ◆ flags

RoadTypeFlags RoadTypeInfo::flags

Bit mask of road type flags.

Definition at line 101 of file road.h.

Referenced by AllocateRoadType(), DrawRoadDepotSprite(), DrawTile_Road(), GetTownRoadType(), GetTownRoadTypeFirstIntroductionDate(), HasRoadCatenary(), HasRoadTypeAvail(), InitRoadTypes(), RoadNoLevelCrossing(), RoadTypeChangeInfo(), and TownCanGrowRoad().

## ◆ grffile

const GRFFile* RoadTypeInfo::grffile[ROTSG_END]

NewGRF providing the Action3 for the roadtype.

nullptr if not available.

Definition at line 161 of file road.h.

## ◆ group

const SpriteGroup* RoadTypeInfo::group[ROTSG_END]

Sprite groups for resolving sprites.

Definition at line 166 of file road.h.

Referenced by GetCustomRoadSprite(), and RoadTypeResolverObject::RoadTypeResolverObject().

## ◆ [struct]

struct { ... } RoadTypeInfo::gui_sprites

struct containing the sprites for the road GUI.

Note
  only sprites referred to directly in the code are listed

Referenced by BuildRoadToolbarWindow::OnInit().

## ◆ introduces_roadtypes

RoadTypes RoadTypeInfo::introduces_roadtypes

Bitmask of which other roadtypes are introduced when this roadtype is introduced.

Definition at line 151 of file road.h.

Referenced by AddDateIntroducedRoadTypes(), AllocateRoadType(), GetCompanyRoadTypes(), GetRoadTypes(), NewVehicleAvailable(), and RoadTypeChangeInfo().

## ◆ introduction_date

TimerGameCalendar::Date RoadTypeInfo::introduction_date

Introduction date.

When #INVALID_DATE or a vehicle using this roadtype gets introduced earlier, the vehicle's introduction date will be used instead for this roadtype. The introduction at this date is furthermore limited by the #introduction_required_types.

Definition at line 140 of file road.h.

Referenced by AddDateIntroducedRoadTypes(), AllocateRoadType(), GetTownRoadType(), GetTownRoadTypeFirstIntroductionDate(), HasRoadTypeAvail(), and RoadTypeChangeInfo().

## ◆ introduction_required_roadtypes

RoadTypes RoadTypeInfo::introduction_required_roadtypes

Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_date.

Definition at line 146 of file road.h.

Referenced by AddDateIntroducedRoadTypes(), and RoadTypeChangeInfo().

## ◆ label

RoadTypeLabel RoadTypeInfo::label

Unique 32 bit road type identifier.

Definition at line 121 of file road.h.

Referenced by AddDateIntroducedRoadTypes(), AllocateRoadType(), RoadTypeResolverObject::GetDebugID(), RoadTypeResolverObject::GetFeature(), GetReverseRoadTypeTranslation(), GetRoadTypeByLabel(), HasRoadTypeAvail(), InitRoadTypes(), and ROTTChunkHandler::Save().

## ◆ maintenance_multiplier

uint16_t RoadTypeInfo::maintenance_multiplier

Cost multiplier for maintenance of this road type.

Definition at line 111 of file road.h.

Referenced by RoadTypeChangeInfo().

## ◆ map_colour

PixelColour RoadTypeInfo::map_colour

Colour on mini-map.

Definition at line 131 of file road.h.

Referenced by GetSmallMapRoutesPixels(), and RoadTypeChangeInfo().

## ◆ max_speed

uint16_t RoadTypeInfo::max_speed

Maximum speed for vehicles travelling on this road type.

Definition at line 116 of file road.h.

Referenced by RoadVehicle::GetMaxTrackSpeed(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit(), GetTownRoadType(), BuildRoadToolbarWindow::GetWidgetString(), and RoadTypeChangeInfo().

## ◆ menu_text

StringID RoadTypeInfo::menu_text

Name of this rail type in the main toolbar dropdown.

Definition at line 79 of file road.h.

Referenced by RoadTypeChangeInfo().

## ◆ name

StringID RoadTypeInfo::name

Name of this rail type.

Definition at line 77 of file road.h.

Referenced by RoadTypeChangeInfo(), and CompanyInfrastructureWindow::UpdateWidgetSize().

## ◆ new_engine

StringID RoadTypeInfo::new_engine

Name of an engine for this type of road in the engine preview GUI.

Definition at line 82 of file road.h.

Referenced by GetEngineCategoryName(), and RoadTypeChangeInfo().

## ◆ picker_title

StringID RoadTypeInfo::picker_title[2]

Title for the station picker for bus or truck stations.

Definition at line 91 of file road.h.

## ◆ picker_tooltip

StringID RoadTypeInfo::picker_tooltip[2]

Tooltip for the station picker for bus or truck stations.

Definition at line 92 of file road.h.

## ◆ powered_roadtypes

RoadTypes RoadTypeInfo::powered_roadtypes

bitmask to the OTHER roadtypes on which a vehicle of THIS roadtype generates power

Definition at line 96 of file road.h.

Referenced by AfterLoadVehiclesPhase2(), AllocateRoadType(), CheckAutoreplaceValidity(), HasPowerOnRoad(), IsEngineBuildable(), and RoadTypeChangeInfo().

## ◆ replace_text

StringID RoadTypeInfo::replace_text

Text used in the autoreplace GUI.

Definition at line 81 of file road.h.

Referenced by ReplaceVehicleWindow::GetWidgetString(), RoadTypeChangeInfo(), and ReplaceVehicleWindow::UpdateWidgetSize().

## ◆ road_nwse

CursorID RoadTypeInfo::road_nwse

Cursor for building rail in Y direction.

Definition at line 69 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick().

## ◆ road_swne

CursorID RoadTypeInfo::road_swne

Cursor for building rail in X direction.

Definition at line 68 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick().

## ◆ sorting_order

uint8_t RoadTypeInfo::sorting_order

The sorting order of this roadtype for the toolbar dropdown.

Definition at line 156 of file road.h.

Referenced by AllocateRoadType(), CompareRoadTypes(), and RoadTypeChangeInfo().

## ◆ toolbar_caption

StringID RoadTypeInfo::toolbar_caption

Caption in the construction toolbar GUI for this rail type.

Definition at line 78 of file road.h.

Referenced by BuildRoadToolbarWindow::GetWidgetString(), and RoadTypeChangeInfo().

## ◆ tunnel

CursorID RoadTypeInfo::tunnel

Cursor for building a tunnel.

Definition at line 72 of file road.h.

Referenced by BuildRoadToolbarWindow::OnClick().

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

- src/road.h
- src/road.cpp