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