Go to the documentation of this file.
128 return (_price[PR_INFRASTRUCTURE_ROAD] *
GetRoadTypeInfo(roadtype)->maintenance_multiplier * num * (1 +
IntSqrt(total_num))) >> 12;
@ ROADTYPE_END
Used for iterations.
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.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
void MarkDirtyAdjacentLevelCrossingTiles(TileIndex tile, Axis road_axis)
Find adjacent level crossing tiles in this multi-track crossing and mark them dirty.
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.
static bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
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.
@ ROAD_X
Full road along the x-axis (south-west + north-east)
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
@ ROAD_ALL
Full 4-way crossing.
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.
@ ROAD_END
Out-of-range roadbits, used for iterations.
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.
void UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(TileIndex tile, Axis road_axis)
Update adjacent level crossing tiles in this multi-track crossing, due to removal of a level crossing...
DiagDirection
Enumeration for diagonal directions.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
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.
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
RoadType
The different roadtypes we support.
RoadBits
Enumeration for the road parts on a tile.
void UpdateLevelCrossing(TileIndex tile, bool sound=true, bool force_bar=false)
Update a level crossing to barred or open (crossing may include multiple adjacent tiles).
@ ROAD_NW
North-west part.
void DrawRoadOverlays(const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rit, uint road_offset, uint tram_offset, bool draw_underlay=true)
Draw road underlay and overlay sprites.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.