24 enum RoadTramType :
bool {
29 enum RoadTramTypes : uint8 {
30 RTTB_ROAD = 1 << RTT_ROAD,
31 RTTB_TRAM = 1 << RTT_TRAM,
35 #define FOR_ALL_ROADTRAMTYPES(x) for (RoadTramType x : { RTT_ROAD, RTT_TRAM }) 191 inline bool UsesOverlay()
const 199 static inline bool RoadTypeIsRoad(
RoadType roadtype)
201 return !
HasBit(_roadtypes_type, roadtype);
204 static inline bool RoadTypeIsTram(
RoadType roadtype)
206 return HasBit(_roadtypes_type, roadtype);
209 static inline RoadTramType GetRoadTramType(
RoadType roadtype)
211 return RoadTypeIsTram(roadtype) ? RTT_TRAM : RTT_ROAD;
214 static inline RoadTramType OtherRoadTramType(RoadTramType rtt)
216 return rtt == RTT_ROAD ? RTT_TRAM : RTT_ROAD;
228 return &_roadtypes[roadtype];
265 if (RoadTypeIsRoad(roadtype))
return _price[PR_CLEAR_ROAD];
269 return _price[PR_CLEAR_ROAD] -
RoadBuildCost(roadtype) * 3 / 4;
281 if (from == to)
return (
Money)0;
305 extern std::vector<RoadType> _sorted_roadtypes;
312 #define FOR_ALL_SORTED_ROADTYPES(var) for (uint8 index = 0; index < _sorted_roadtypes.size() && (var = _sorted_roadtypes[index], true) ; index++) Owner
Enum for all companies/owners.
void ResetRoadTypes()
Reset all road type information to its default values.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Placeholder, if we need specific tunnel sprites.
Enums and other types related to roads.
RoadTypes _roadtypes_type
Bitmap of road/tram types.
CursorID autoroad
Cursor for autorail tool.
byte map_colour
Colour on mini-map.
RoadTypeSpriteGroup
Sprite groups for a roadtype.
CursorID depot
Cursor for building a depot.
SpriteID build_depot
button for building depots
RoadTypes
The different roadtypes we support, but then a bitmask of them.
bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
Test if any buildable RoadType is available for a company.
RoadTypeFlags flags
Bit mask of road type flags.
StringID toolbar_caption
Caption in the construction toolbar GUI for this rail type.
RoadType AllocateRoadType(RoadTypeLabel label, RoadTramType rtt)
Allocate a new road type label.
SpriteID build_x_road
button for building single rail in X direction
SpriteID build_tunnel
button for building a tunnel
StringID new_engine
Name of an engine for this type of road in the engine preview GUI.
RoadTypeFlags
Roadtype flags.
Value for allowing towns to build this roadtype.
Functions related to bit mathematics.
StringID build_caption
Caption of the build vehicle GUI for this rail type.
Bit number for hidden from construction.
Required: Drive-in stop surface.
Value for hidden from construction.
RoadType
The different roadtypes we support.
StringID err_convert_road
Converting a road type.
const SpriteGroup * group[ROTSG_END]
Sprite groups for resolving sprites.
Type (helpers) for enums.
Bit number for adding catenary.
StringID replace_text
Text used in the autoreplace GUI.
Bit number for setting this roadtype as not house friendly.
StringID name
Name of this rail type.
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
Bit number for allowing towns to build this roadtype.
RoadTypes powered_roadtypes
bitmask to the OTHER roadtypes on which a vehicle of THIS roadtype generates power ...
StringID err_remove_station[2]
Removing of a bus or truck station.
StringID picker_tooltip[2]
Tooltip for the station picker for bus or truck stations.
StringID picker_title[2]
Title for the station picker for bus or truck stations.
static Money RoadClearCost(RoadType roadtype)
Returns the cost of clearing the specified roadtype.
uint16 maintenance_multiplier
Cost multiplier for maintenance of this road type.
Value for for setting this roadtype as not house friendly.
RoadType GetRoadTypeByLabel(RoadTypeLabel label, bool allow_alternate_labels=true)
Get the road type for a given label.
Optional: Catenary front.
StringID menu_text
Name of this rail type in the main toolbar dropdown.
uint16 max_speed
Maximum speed for vehicles travelling on this road type.
static Money RoadBuildCost(RoadType roadtype)
Returns the cost of building the specified roadtype.
Optional: Cursor and toolbar icon images.
StringID err_remove_road
Removing a normal piece of road.
struct RoadTypeInfo::@42 strings
Strings associated with the rail type.
struct RoadTypeInfo::@40 gui_sprites
struct containing the sprites for the road GUI.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
std::vector< RoadTypeLabel > RoadTypeLabelList
List of road type labels.
byte sorting_order
The sorting order of this roadtype for the toolbar dropdown.
CursorID road_nwse
Cursor for building rail in Y direction.
StringID err_depot
Building a depot.
void InitRoadTypes()
Resolve sprites of custom road types.
static bool HasPowerOnRoad(RoadType enginetype, RoadType tiletype)
Checks if an engine of the given RoadType got power on a tile with a given RoadType.
Required: Bridge surface images.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint16 cost_multiplier
Cost multiplier for building this road type.
CursorID road_swne
Cursor for building rail in X direction.
Value for disabling a level crossing.
static bool RoadNoLevelCrossing(RoadType roadtype)
Test if road disallows level crossings.
Functions related to the economy.
Date introduction_date
Introduction date.
StringID err_build_road
Building a normal piece of road.
Value for drawing a catenary.
SpriteID build_y_road
button for building single rail in Y direction
Placeholder, if we add road fences (for highways).
uint32 CursorID
The number of the cursor (sprite)
CursorID tunnel
Cursor for building a tunnel.
Types related to strings.
Types related to the dates in OpenTTD.
Placeholder, if we need specific level crossing sprites.
int32 Date
The type to store our dates in.
Bit number for disabling level crossing.
RoadTypes introduction_required_roadtypes
Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_dat...
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static Money RoadConvertCost(RoadType from, RoadType to)
Calculates the cost of road conversion.
Required: Main group of ground images.
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced. ...
RoadTypeLabelList alternate_labels
Road type labels this type provides in addition to the main label.
const GRFFile * grffile[ROTSG_END]
NewGRF providing the Action3 for the roadtype.
SpriteID auto_road
button for the autoroad construction
struct RoadTypeInfo::@41 cursor
Cursors associated with the road type.
SpriteID convert_road
button for converting road types
StringID err_build_station[2]
Building a bus or truck station.
Optional: Images for overlaying track.
Types related to the graphics and/or input devices.
RoadTypeLabel label
Unique 32 bit road type identifier.
Dynamic data of a loaded NewGRF.
Base for the NewGRF implementation.