OpenTTD Source: src/table/roadtypes.h Source File

OpenTTD Source 15.0-RC2

roadtypes.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
13#ifndef ROADTYPES_H
14#define ROADTYPES_H
15
16#include "table/strings.h"
17
21 static const RoadTypeInfo _original_roadtypes[] = {
22 /* Road */
23 {
24 /* GUI sprites */
25 {
26 SPR_IMG_ROAD_X_DIR,
27 SPR_IMG_ROAD_Y_DIR,
28 SPR_IMG_AUTOROAD,
29 SPR_IMG_ROAD_DEPOT,
30 SPR_IMG_ROAD_TUNNEL,
31 SPR_IMG_CONVERT_ROAD,
32 },
33
34 {
35 SPR_CURSOR_ROAD_NESW,
36 SPR_CURSOR_ROAD_NWSE,
37 SPR_CURSOR_AUTOROAD,
38 SPR_CURSOR_ROAD_DEPOT,
39 SPR_CURSOR_ROAD_TUNNEL,
40 SPR_CURSOR_CONVERT_ROAD,
41 },
42
43 /* strings */
44 {
45 STR_ROAD_NAME_ROAD,
46 STR_ROAD_TOOLBAR_ROAD_CONSTRUCTION_CAPTION,
47 STR_ROAD_MENU_ROAD_CONSTRUCTION,
48 STR_BUY_VEHICLE_ROAD_VEHICLE_CAPTION,
49 STR_REPLACE_ROAD_VEHICLES,
50 STR_ENGINE_PREVIEW_ROAD_VEHICLE,
51
52 STR_ERROR_CAN_T_BUILD_ROAD_HERE,
53 STR_ERROR_CAN_T_REMOVE_ROAD_FROM,
54 STR_ERROR_CAN_T_BUILD_ROAD_DEPOT,
55 { STR_ERROR_CAN_T_BUILD_BUS_STATION, STR_ERROR_CAN_T_BUILD_TRUCK_STATION },
56 { STR_ERROR_CAN_T_REMOVE_BUS_STATION, STR_ERROR_CAN_T_REMOVE_TRUCK_STATION },
57 STR_ERROR_CAN_T_CONVERT_ROAD,
58 { STR_STATION_BUILD_BUS_ORIENTATION, STR_STATION_BUILD_TRUCK_ORIENTATION },
59 { STR_STATION_BUILD_BUS_ORIENTATION_TOOLTIP, STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP },
60 },
61
62 /* Powered roadtypes */
63 {ROADTYPE_ROAD},
64
65 /* flags */
66 {RoadTypeFlag::TownBuild},
67
68 /* cost multiplier */
69 8,
70
71 /* maintenance cost multiplier */
72 16,
73
74 /* max speed */
75 0,
76
77 /* road type label */
78 ROADTYPE_LABEL_ROAD,
79
80 /* alternate labels */
81 {},
82
83 /* map colour */
84 PC_BLACK,
85
86 /* introduction date */
87 CalendarTime::MIN_DATE,
88
89 /* roadtypes required for this to be introduced */
90 {},
91
92 /* introduction road types */
93 {ROADTYPE_ROAD},
94
95 /* sort order */
96 0x07,
97
98 { nullptr },
99 { nullptr },
100 {},
101 },
102
103 /* Electrified Tram */
104 {
105 /* GUI sprites */
106 {
107 SPR_IMG_TRAMWAY_X_DIR,
108 SPR_IMG_TRAMWAY_Y_DIR,
109 SPR_IMG_AUTOTRAM,
110 SPR_IMG_ROAD_DEPOT,
111 SPR_IMG_ROAD_TUNNEL,
112 SPR_IMG_CONVERT_TRAM,
113 },
114
115 {
116 SPR_CURSOR_TRAMWAY_NESW,
117 SPR_CURSOR_TRAMWAY_NWSE,
118 SPR_CURSOR_AUTOTRAM,
119 SPR_CURSOR_ROAD_DEPOT,
120 SPR_CURSOR_ROAD_TUNNEL,
121 SPR_CURSOR_CONVERT_TRAM,
122 },
123
124 /* strings */
125 {
126 STR_ROAD_NAME_TRAM,
127 STR_ROAD_TOOLBAR_TRAM_CONSTRUCTION_CAPTION,
128 STR_ROAD_MENU_TRAM_CONSTRUCTION,
129 STR_BUY_VEHICLE_TRAM_VEHICLE_CAPTION,
130 STR_REPLACE_TRAM_VEHICLES,
131 STR_ENGINE_PREVIEW_TRAM_VEHICLE,
132
133 STR_ERROR_CAN_T_BUILD_TRAMWAY_HERE,
134 STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM,
135 STR_ERROR_CAN_T_BUILD_TRAM_DEPOT,
136 { STR_ERROR_CAN_T_BUILD_PASSENGER_TRAM_STATION, STR_ERROR_CAN_T_BUILD_CARGO_TRAM_STATION },
137 { STR_ERROR_CAN_T_REMOVE_PASSENGER_TRAM_STATION, STR_ERROR_CAN_T_REMOVE_CARGO_TRAM_STATION },
138 STR_ERROR_CAN_T_CONVERT_TRAMWAY,
139 { STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION, STR_STATION_BUILD_CARGO_TRAM_ORIENTATION },
140 { STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION_TOOLTIP, STR_STATION_BUILD_CARGO_TRAM_ORIENTATION_TOOLTIP },
141 },
142
143 /* Powered roadtypes */
144 {ROADTYPE_TRAM},
145
146 /* flags */
147 {RoadTypeFlag::Catenary, RoadTypeFlag::NoHouses},
148
149 /* cost multiplier */
150 16,
151
152 /* maintenance cost multiplier */
153 24,
154
155 /* max speed */
156 0,
157
158 /* road type label */
159 ROADTYPE_LABEL_TRAM,
160
161 /* alternate labels */
162 {},
163
164 /* map colour */
165 PC_BLACK,
166
167 /* introduction date */
168 CalendarTime::INVALID_DATE,
169
170 /* roadtypes required for this to be introduced */
171 {},
172
173 /* introduction road types */
174 {ROADTYPE_TRAM},
175
176 /* sort order */
177 0x17,
178
179 { nullptr },
180 { nullptr },
181 {},
182 },
183};
184
185#endif /* ROADTYPES_H */
RoadTypeInfo
Definition road.h:52
TimerGameConst< struct Calendar >::MIN_DATE
static constexpr TimerGame< struct Calendar >::Date MIN_DATE
The date on January 1, year 0.
Definition timer_game_common.h:190
TimerGameConst< struct Calendar >::INVALID_DATE
static constexpr TimerGame< struct Calendar >::Date INVALID_DATE
Representation of an invalid date.
Definition timer_game_common.h:193
PC_BLACK
static constexpr PixelColour PC_BLACK
Black palette colour.
Definition palette_func.h:96
RoadTypeFlag::Catenary
@ Catenary
Bit number for adding catenary.
RoadTypeFlag::NoHouses
@ NoHouses
Bit number for setting this roadtype as not house friendly.
RoadTypeFlag::TownBuild
@ TownBuild
Bit number for allowing towns to build this roadtype.
ROADTYPE_TRAM
@ ROADTYPE_TRAM
Trams.
Definition road_type.h:26
ROADTYPE_ROAD
@ ROADTYPE_ROAD
Basic road type.
Definition road_type.h:25
_original_roadtypes
static const RoadTypeInfo _original_roadtypes[]
Global Roadtype definition.
Definition roadtypes.h:21