Functions related to bit mathematics.
static constexpr uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr Tstorage base() const noexcept
Retrieve the raw value behind this bit set.
constexpr Timpl & Flip()
Flip all bits.
constexpr Timpl & Reset()
Reset all bits.
RoadTypeFlags flags
Bit mask of road type flags.
StrongType::Typedef< int32_t, DateTag< struct Calendar >, StrongType::Compare, StrongType::Integer > Date
bool IsValidAxis(Axis d)
Checks if an integer value is a valid Axis.
bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
Axis
Enumeration for the two axis X and Y.
DiagDirection
Enumeration for diagonal directions.
Prices _price
Prices and also the fractional part.
Functions related to the economy.
@ InfrastructureRoad
Roads maintenance cost.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23).
uint32_t PaletteID
The number of the palette.
uint32_t IntSqrt(uint32_t num)
Compute the integer square root.
@ Catenary
Bit number for adding catenary.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
bool HasRoadTypeAvail(CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction.
RoadBits AxisToRoadBits(Axis a)
Create the road-part which belongs to the given Axis.
bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
bool HasRoadCatenaryDrawn(RoadType roadtype)
Test if we should draw road catenary.
void UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(TileIndex tile, Axis road_axis)
Update adjacent level crossing tiles in this multi-track crossing, due to removal of a level crossing...
bool UpdateNearestTownForRoadTiles(bool invalidate)
Updates cached nearest town for all road tiles.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
void DrawRoadGroundSprites(const TileInfo *ti, RoadBits road, RoadBits tram, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rti, Roadside roadside, bool snow_or_desert)
Draw road ground sprites.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt)
Draw the road depot sprite.
bool HasRoadCatenary(RoadType roadtype)
Test if a road type has catenary.
void UpdateCompanyRoadInfrastructure(RoadType rt, Owner o, int count)
Update road infrastructure counts for a company.
Money RoadMaintenanceCost(RoadType roadtype, uint32_t num, uint32_t total_num)
Calculates the maintenance cost of a number of road bits.
bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, TimerGameCalendar::Date date)
Add the road types that are to be introduced at the given date.
RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
void MarkDirtyAdjacentLevelCrossingTiles(TileIndex tile, Axis road_axis)
Find adjacent level crossing tiles in this multi-track crossing and mark them dirty.
RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
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).
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.
RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces=true)
Get the road types the given company can build.
Roadside
The possible road side decorations.
EnumBitSet< RoadType, uint64_t > RoadTypes
Bitset of RoadType elements.
static constexpr RoadBits ROAD_X
Full road along the x-axis (south-west + north-east).
EnumBitSet< RoadBit, uint8_t > RoadBits
Bitset of RoadBit elements.
static constexpr RoadBits ROAD_ALL
Full 4-way crossing.
static constexpr RoadBits ROAD_Y
Full road along the y-axis (north-west + south-east).
RoadType
The different roadtypes we support.
@ ROADTYPE_END
Used for iterations.
Tile information, used while rendering the tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
Functions related to transparency.
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...