28 #define FOR_EACH_SET_ROADTYPE(var, road_types) FOR_EACH_SET_BIT_EX(RoadType, var, RoadTypes, road_types) 175 return (_price[PR_INFRASTRUCTURE_ROAD] * (roadtype ==
ROADTYPE_TRAM ? 3 : 2) * num * (1 +
IntSqrt(num))) >> 9;
Enums and other types related to roads.
static RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
bool ValParamRoadType(const RoadType rt)
Validate functions for rail building.
bool HasRoadTypesAvail(const CompanyID company, const RoadTypes rts)
Finds out, whether given company has all given RoadTypes available.
Full road along the x-axis (south-west + north-east)
static RoadTypes RoadTypeToRoadTypes(RoadType rt)
Maps a RoadType to the corresponding RoadTypes value.
static RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
Calculate rotated RoadBits.
Functions related to bit mathematics.
RoadType
The different roadtypes we support.
static bool IsValidRoadType(RoadType rt)
Whether the given roadtype is valid.
Out-of-range roadbits, used for iterations.
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
RoadBits
Enumeration for the road parts on a tile.
static bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
DiagDirection
Enumeration for diagonal directions.
void UpdateLevelCrossing(TileIndex tile, bool sound=true)
Sets correct crossing state.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
uint32 TileIndex
The index/ID of a Tile.
Functions related to the economy.
static bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
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.
static RoadTypes ComplementRoadTypes(RoadTypes r)
Returns the RoadTypes which are not present in the given RoadTypes.
uint32 IntSqrt(uint32 num)
Compute the integer square root.
static bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
Full road along the y-axis (north-west + south-east)
Owner
Enum for all companies/owners.
RoadTypes GetCompanyRoadtypes(const CompanyID company)
Get the road types the given company can build.
Axis
Allow incrementing of DiagDirDiff variables.
static Money RoadMaintenanceCost(RoadType roadtype, uint32 num)
Calculates the maintenance cost of a number of road bits.
static RoadBits AxisToRoadBits(Axis a)
Create the road-part which belongs to the given Axis.