23enum RoadTramType :
bool {
28enum RoadTramTypes : uint8_t {
29 RTTB_ROAD = 1 << RTT_ROAD,
30 RTTB_TRAM = 1 << RTT_TRAM,
34static const RoadTramType _roadtramtypes[] = { RTT_ROAD, RTT_TRAM };
194 inline bool UsesOverlay()
const
202inline bool RoadTypeIsRoad(
RoadType roadtype)
207inline bool RoadTypeIsTram(
RoadType roadtype)
212inline RoadTramType GetRoadTramType(
RoadType roadtype)
214 return RoadTypeIsTram(roadtype) ? RTT_TRAM : RTT_ROAD;
217inline RoadTramType OtherRoadTramType(RoadTramType rtt)
219 return rtt == RTT_ROAD ? RTT_TRAM : RTT_ROAD;
231 return &_roadtypes[roadtype];
255 return (_price[PR_BUILD_ROAD] *
GetRoadTypeInfo(roadtype)->cost_multiplier) >> 3;
268 if (RoadTypeIsRoad(roadtype))
return _price[PR_CLEAR_ROAD];
272 return _price[PR_CLEAR_ROAD] -
RoadBuildCost(roadtype) * 3 / 4;
284 if (from == to)
return (
Money)0;
308extern std::vector<RoadType> _sorted_roadtypes;
Functions related to bit mathematics.
debug_inline constexpr bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
RoadTypeLabel label
Unique 32 bit road type identifier.
StringID menu_text
Name of this rail type in the main toolbar dropdown.
StringID replace_text
Text used in the autoreplace GUI.
RoadTypeLabelList alternate_labels
Road type labels this type provides in addition to the main label.
StringID picker_title[2]
Title for the station picker for bus or truck stations.
RoadTypes powered_roadtypes
bitmask to the OTHER roadtypes on which a vehicle of THIS roadtype generates power
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced.
struct RoadTypeInfo::@28 cursor
Cursors associated with the road type.
CursorID autoroad
Cursor for autorail tool.
TimerGameCalendar::Date introduction_date
Introduction date.
const SpriteGroup * group[ROTSG_END]
Sprite groups for resolving sprites.
uint8_t sorting_order
The sorting order of this roadtype for the toolbar dropdown.
StringID picker_tooltip[2]
Tooltip for the station picker for bus or truck stations.
uint16_t maintenance_multiplier
Cost multiplier for maintenance of this road type.
RoadTypeFlags flags
Bit mask of road type flags.
struct RoadTypeInfo::@29 strings
Strings associated with the rail type.
StringID err_build_road
Building a normal piece of road.
StringID err_remove_road
Removing a normal piece of road.
uint8_t map_colour
Colour on mini-map.
CursorID depot
Cursor for building a depot.
const GRFFile * grffile[ROTSG_END]
NewGRF providing the Action3 for the roadtype.
CursorID road_nwse
Cursor for building rail in Y direction.
uint16_t max_speed
Maximum speed for vehicles travelling on this road type.
StringID name
Name of this rail type.
StringID toolbar_caption
Caption in the construction toolbar GUI for this rail type.
SpriteID build_y_road
button for building single rail in Y direction
CursorID tunnel
Cursor for building a tunnel.
SpriteID auto_road
button for the autoroad construction
struct RoadTypeInfo::@27 gui_sprites
struct containing the sprites for the road GUI.
SpriteID convert_road
button for converting road types
CursorID road_swne
Cursor for building rail in X direction.
StringID err_convert_road
Converting a road type.
StringID new_engine
Name of an engine for this type of road in the engine preview GUI.
StringID err_depot
Building a depot.
SpriteID build_x_road
button for building single rail in X direction
SpriteID build_depot
button for building depots
RoadTypes introduction_required_roadtypes
Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_dat...
SpriteID build_tunnel
button for building a tunnel
StringID err_build_station[2]
Building a bus or truck station.
uint16_t cost_multiplier
Cost multiplier for building this road type.
StringID err_remove_station[2]
Removing of a bus or truck station.
StringID build_caption
Caption of the build vehicle GUI for this rail type.
Owner
Enum for all companies/owners.
Functions related to the economy.
Type (helpers) for enums.
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
Types related to the graphics and/or input devices.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32_t CursorID
The number of the cursor (sprite)
Base for the NewGRF implementation.
void ResetRoadTypes()
Reset all road type information to its default values.
void InitRoadTypes()
Resolve sprites of custom road types.
bool HasPowerOnRoad(RoadType enginetype, RoadType tiletype)
Checks if an engine of the given RoadType got power on a tile with a given RoadType.
RoadTypes _roadtypes_type
Bitmap of road/tram types.
RoadTypeFlag
Roadtype flag bit numbers.
@ ROTF_NO_HOUSES
Bit number for setting this roadtype as not house friendly.
@ ROTF_HIDDEN
Bit number for hidden from construction.
@ ROTF_NO_LEVEL_CROSSING
Bit number for disabling level crossing.
@ ROTF_TOWN_BUILD
Bit number for allowing towns to build this roadtype.
@ ROTF_CATENARY
Bit number for adding catenary.
Money RoadClearCost(RoadType roadtype)
Returns the cost of clearing the specified roadtype.
RoadTypeFlags
Roadtype flags.
@ ROTFB_NO_HOUSES
Value for for setting this roadtype as not house friendly.
@ ROTFB_NONE
All flags cleared.
@ ROTFB_HIDDEN
Value for hidden from construction.
@ ROTFB_CATENARY
Value for drawing a catenary.
@ ROTFB_TOWN_BUILD
Value for allowing towns to build this roadtype.
@ ROTFB_NO_LEVEL_CROSSING
Value for disabling a level crossing.
bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
Test if any buildable RoadType is available for a company.
std::vector< RoadTypeLabel > RoadTypeLabelList
List of road type labels.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
Money RoadConvertCost(RoadType from, RoadType to)
Calculates the cost of road conversion.
RoadType GetRoadTypeByLabel(RoadTypeLabel label, bool allow_alternate_labels=true)
Get the road type for a given label.
RoadTypeSpriteGroup
Sprite groups for a roadtype.
@ ROTSG_ONEWAY
Optional: One-way indicator images.
@ ROTSG_OVERLAY
Optional: Images for overlaying track.
@ ROTSG_reserved2
Placeholder, if we need specific level crossing sprites.
@ ROTSG_ROADSTOP
Required: Bay stop surface.
@ ROTSG_GROUND
Required: Main group of ground images.
@ ROTSG_DEPOT
Optional: Depot images.
@ ROTSG_CURSORS
Optional: Cursor and toolbar icon images.
@ ROTSG_CATENARY_BACK
Optional: Catenary back.
@ ROTSG_BRIDGE
Required: Bridge surface images.
@ ROTSG_reserved3
Placeholder, if we add road fences (for highways).
@ ROTSG_CATENARY_FRONT
Optional: Catenary front.
@ ROTSG_TUNNEL
Optional: Ground images for tunnels.
bool RoadNoLevelCrossing(RoadType roadtype)
Test if road disallows level crossings.
RoadType AllocateRoadType(RoadTypeLabel label, RoadTramType rtt)
Allocate a new road type label.
Money RoadBuildCost(RoadType roadtype)
Returns the cost of building the specified roadtype.
Enums and other types related to roads.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
RoadType
The different roadtypes we support.
@ ROADTYPE_END
Used for iterations.
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Dynamic data of a loaded NewGRF.
Templated helper to make a type-safe 'typedef' representing a single POD value.
Definition of the game-calendar-timer.