OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
24 enum RoadTramType :
bool {
29 enum RoadTramTypes : uint8 {
30 RTTB_ROAD = 1 << RTT_ROAD,
31 RTTB_TRAM = 1 << RTT_TRAM,
35 static const RoadTramType _roadtramtypes[] = { RTT_ROAD, RTT_TRAM };
191 inline bool UsesOverlay()
const
199 static inline bool RoadTypeIsRoad(
RoadType roadtype)
204 static inline bool RoadTypeIsTram(
RoadType 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];
252 return (_price[PR_BUILD_ROAD] *
GetRoadTypeInfo(roadtype)->cost_multiplier) >> 3;
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;
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.
@ ROTF_NO_LEVEL_CROSSING
Bit number for disabling level crossing.
StringID toolbar_caption
Caption in the construction toolbar GUI for this rail type.
@ ROTSG_GROUND
Required: Main group of ground images.
StringID err_build_road
Building a normal piece of road.
StringID menu_text
Name of this rail type in the main toolbar dropdown.
@ ROTF_CATENARY
Bit number for adding catenary.
@ ROTFB_TOWN_BUILD
Value for allowing towns to build this roadtype.
SpriteID build_y_road
button for building single rail in Y direction
@ ROTSG_reserved2
Placeholder, if we need specific level crossing sprites.
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced.
@ ROTF_TOWN_BUILD
Bit number for allowing towns to build this roadtype.
byte sorting_order
The sorting order of this roadtype for the toolbar dropdown.
static Money RoadConvertCost(RoadType from, RoadType to)
Calculates the cost of road conversion.
SpriteID build_depot
button for building depots
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
StringID err_remove_station[2]
Removing of a bus or truck station.
@ ROADTYPE_END
Used for iterations.
CursorID tunnel
Cursor for building a tunnel.
StringID replace_text
Text used in the autoreplace GUI.
Date introduction_date
Introduction date.
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.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
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.
uint32 CursorID
The number of the cursor (sprite)
@ ROTF_HIDDEN
Bit number for hidden from construction.
bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
Test if any buildable RoadType is available for a company.
SpriteID auto_road
button for the autoroad construction
int32 Date
The type to store our dates in.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
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: Drive-in stop surface.
@ ROTF_NO_HOUSES
Bit number for setting this roadtype as not house friendly.
@ ROTSG_BRIDGE
Required: Bridge surface images.
@ ROTFB_CATENARY
Value for drawing a catenary.
StringID name
Name of this rail type.
SpriteID build_tunnel
button for building a tunnel
RoadType
The different roadtypes we support.
StringID picker_tooltip[2]
Tooltip for the station picker for bus or truck stations.
@ ROTFB_NO_HOUSES
Value for for setting this roadtype as not house friendly.
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.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
struct RoadTypeInfo::@40 gui_sprites
struct containing the sprites for the road GUI.
RoadTypeLabel label
Unique 32 bit road type identifier.
StringID err_build_station[2]
Building a bus or truck station.
struct RoadTypeInfo::@41 cursor
Cursors associated with the road type.
@ ROTSG_OVERLAY
Optional: Images for overlaying track.
CursorID autoroad
Cursor for autorail tool.
static Money RoadClearCost(RoadType roadtype)
Returns the cost of clearing the specified roadtype.
StringID err_convert_road
Converting a road type.
byte map_colour
Colour on mini-map.
@ ROTSG_CATENARY_FRONT
Optional: Catenary front.
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
uint16 cost_multiplier
Cost multiplier for building this road type.
@ ROTSG_DEPOT
Optional: Depot images.
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.
static bool HasPowerOnRoad(RoadType enginetype, RoadType tiletype)
Checks if an engine of the given RoadType got power on a tile with a given RoadType.
RoadTypeFlags
Roadtype flags.
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.
@ ROTFB_NONE
All flags cleared.
@ ROTSG_reserved1
Placeholder, if we need specific tunnel sprites.
StringID err_depot
Building a depot.
static bool RoadNoLevelCrossing(RoadType roadtype)
Test if road disallows level crossings.
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.
uint16 maintenance_multiplier
Cost multiplier for maintenance of this road type.
@ ROTFB_NO_LEVEL_CROSSING
Value for disabling a level crossing.
struct RoadTypeInfo::@42 strings
Strings associated with the rail type.
@ ROTFB_HIDDEN
Value for hidden from construction.