Go to the documentation of this file.
128 return (_price[PR_INFRASTRUCTURE_ROAD] *
GetRoadTypeInfo(roadtype)->maintenance_multiplier * num * (1 +
IntSqrt(total_num))) >> 12;
uint32 TileIndex
The index/ID of a Tile.
static bool IsValidAxis(Axis d)
Checks if an integer value is a valid Axis.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
@ ROTF_CATENARY
Bit number for adding catenary.
Tile information, used while rendering the tile.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
@ ROAD_END
Out-of-range roadbits, used for iterations.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces=true)
Get the road types the given company can build.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
@ ROAD_X
Full road along the x-axis (south-west + north-east)
static bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
@ ROADTYPE_END
Used for iterations.
uint32 IntSqrt(uint32 num)
Compute the integer square root.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, Date date)
Add the road types that are to be introduced at the given date.
Owner
Enum for all companies/owners.
static bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
static bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
static RoadBits AxisToRoadBits(Axis a)
Create the road-part which belongs to the given Axis.
RoadBits
Enumeration for the road parts on a tile.
static RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
Calculate rotated RoadBits.
static RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
bool HasRoadTypeAvail(CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction.
void DrawRoadOverlays(const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rit, uint road_offset, uint tram_offset)
Draw road underlay and overlay sprites.
int32 Date
The type to store our dates in.
static bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
static bool HasRoadCatenaryDrawn(RoadType roadtype)
Test if we should draw road catenary.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
static Money RoadMaintenanceCost(RoadType roadtype, uint32 num, uint32 total_num)
Calculates the maintenance cost of a number of road bits.
@ ROAD_ALL
Full 4-way crossing.
void UpdateLevelCrossing(TileIndex tile, bool sound=true)
Sets correct crossing state.
DiagDirection
Enumeration for diagonal directions.
RoadType
The different roadtypes we support.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
@ ROAD_NW
North-west part.
void UpdateCompanyRoadInfrastructure(RoadType rt, Owner o, int count)
Update road infrastructure counts for a company.
static bool HasRoadCatenary(RoadType roadtype)
Test if a road type has catenary.
uint32 PaletteID
The number of the palette.
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
Axis
Allow incrementing of DiagDirDiff variables.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.