115 default: NOT_REACHED();
155 default: NOT_REACHED();
179 SB(
_me[t].m7, 6, 2, rt);
203 default: NOT_REACHED();
223 default: NOT_REACHED();
286 SB(
_m[t].m5, 4, 2, drd);
366 SB(
_m[t].m5, 4, 1, b ? 1 : 0);
401 SB(
_m[t].m5, 5, 1, barred ? 1 : 0);
423 #define IsOnDesert IsOnSnow 435 #define ToggleDesert ToggleSnow 474 SB(
_me[tile].m6, 3, 3, s);
494 AB(
_me[t].m7, 0, 4, 1);
496 return GB(
_me[t].m7, 0, 4) == 15;
525 SB(
_me[t].m7, 0, 4, 0);
561 SB(
_me[t].m6, 2, 4, 0);
562 _me[t].
m7 = rot << 6;
585 SB(
_me[t].m6, 2, 4, 0);
586 _me[t].
m7 = rot << 6 | road;
606 SB(
_me[t].m6, 2, 4, 0);
Helper template class that makes basic properties of given enumeration type visible from outsize...
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
uint16 DepotID
Type for the unique identifier of depots.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
RailType
Enumeration for all possible railtypes.
static void StartRoadWorks(TileIndex t)
Start road works on a tile.
Functions related to roads.
static RoadBits GetAllRoadBits(TileIndex tile)
Get all set RoadBits on the given tile.
static bool IsRoadOwner(TileIndex t, RoadType rt, Owner o)
Check if a specific road type is owned by an owner.
static T AB(T &x, const uint8 s, const uint8 n, const U i)
Add i to n bits of x starting at bit s.
static T ToggleBit(T &x, const uint8 y)
Toggles a bit in a variable.
static bool HasCrossingReservation(TileIndex t)
Get the reservation state of the rail crossing.
byte m7
Primarily used for newgrf support.
uint16 m2
Primarily used for indices to towns, industries and stations.
Track
These are used to specify a single track.
static TrackBits GetCrossingRailBits(TileIndex tile)
Get the rail track bits of a level crossing.
A tile with road (or tram tracks)
static TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Full road along the x-axis (south-west + north-east)
Tile * _m
Tiles of the map.
static void MakeRoadDepot(TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt)
Make a road depot.
static RoadTypes RoadTypeToRoadTypes(RoadType rt)
Maps a RoadType to the corresponding RoadTypes value.
static bool HasTileRoadType(TileIndex t, RoadType rt)
Check if a tile has a specific road type.
static RoadBits GetRoadBits(TileIndex t, RoadType rt)
Get the present road bits for a specific road type.
static Roadside GetRoadside(TileIndex tile)
Get the decorations of a road.
static void TerminateRoadWorks(TileIndex t)
Terminate road works on a tile.
static DiagDirection GetRoadDepotDirection(TileIndex t)
Get the direction of the exit of a road depot.
static Track AxisToTrack(Axis a)
Convert an Axis to the corresponding Track AXIS_X -> TRACK_X AXIS_Y -> TRACK_Y Uses the fact that the...
static bool IsLevelCrossing(TileIndex t)
Return whether a tile is a level crossing.
static void SetDisallowedRoadDirections(TileIndex t, DisallowedRoadDirections drd)
Sets the disallowed directions.
RoadType
The different roadtypes we support.
Road with paved sidewalks.
RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance=false)
Returns the RoadBits on an arbitrary tile Special behaviour:
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
Roadside
The possible road side decorations.
static bool HasRoadWorks(TileIndex t)
Check if a tile has road works.
static void SetCrossingBarred(TileIndex t, bool barred)
Set the bar state of a level crossing.
TrackBits
Bitfield corresponding to Track.
static bool IsOnSnow(TileIndex t)
Check if a road tile has snow/desert.
static void SetCrossingReservation(TileIndex t, bool b)
Set the reservation state of the rail crossing.
Header files for depots (not hangars)
None of the directions are disallowed.
All northbound traffic is disallowed.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
static TrackBits GetCrossingReservationTrackBits(TileIndex t)
Get the reserved track bits for a rail crossing.
static Owner GetRoadOwner(TileIndex t, RoadType rt)
Get the owner of a specific road type.
Road with trees on paved sidewalks.
RoadTileType
The different types of road tiles.
static void SetRoadOwner(TileIndex t, RoadType rt, Owner o)
Set the owner of a specific road type.
static bool HasTownOwnedRoad(TileIndex t)
Checks if given tile has town owned road.
Informative template class exposing basic enumeration properties used by several other templates belo...
TileExtended * _me
Extended Tiles of the map.
RoadBits
Enumeration for the road parts on a tile.
static bool IsRoadDepotTile(TileIndex t)
Return whether a tile is a road depot tile.
static Axis GetCrossingRailAxis(TileIndex t)
Get the rail axis of a level crossing.
static Axis GetCrossingRoadAxis(TileIndex t)
Get the road axis of a level crossing.
Road with street lights on paved sidewalks.
static void SetRoadBits(TileIndex t, RoadBits r, RoadType rt)
Set the present road bits for a specific road type.
The tile has no ownership.
DiagDirection
Enumeration for diagonal directions.
static void ToggleSnow(TileIndex t)
Toggle the snow/desert state of a road tile.
All directions are disallowed.
static void BarCrossing(TileIndex t)
Bar a level crossing.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
static void SetRoadside(TileIndex tile, Roadside s)
Set the decorations of a road.
static RoadBits GetCrossingRoadBits(TileIndex tile)
Get the road bits of a level crossing.
static bool IsNormalRoadTile(TileIndex t)
Return whether a tile is a normal road tile.
static RoadTileType GetRoadTileType(TileIndex t)
Get the type of the road tile.
Tunnel entry/exit and bridge heads.
Road with sidewalks and road works.
uint32 TileIndex
The index/ID of a Tile.
A town owns the tile, or a town is expanding.
static bool IsLevelCrossingTile(TileIndex t)
Return whether a tile is a level crossing tile.
static void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadTypes rot, uint town)
Make a level crossing.
static bool IncreaseRoadWorksCounter(TileIndex t)
Increase the progress counter of road works.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static void SetTileType(TileIndex tile, TileType type)
Set the type of a tile.
static void UnbarCrossing(TileIndex t)
Unbar a level crossing.
Road on grass with road works.
static RoadBits GetOtherRoadBits(TileIndex t, RoadType rt)
Get all RoadBits set on a tile except from the given RoadType.
static Axis OtherAxis(Axis a)
Select the other axis as provided.
DisallowedRoadDirections
Which directions are disallowed ?
static void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram)
Make a normal road tile.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable...
static DisallowedRoadDirections GetDisallowedRoadDirections(TileIndex t)
Gets the disallowed directions.
static RoadTypes GetRoadTypes(TileIndex t)
Get the present road types of a tile.
static bool IsNormalRoad(TileIndex t)
Return whether a tile is a normal road.
All southbound traffic is disallowed.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static bool IsCrossingBarred(TileIndex t)
Check if the level crossing is barred.
Full road along the y-axis (north-west + south-east)
static Track GetCrossingRailTrack(TileIndex tile)
Get the rail track of a level crossing.
Map writing/reading functions for tiles.
Owner
Enum for all companies/owners.
Different conversion functions from one kind of track to another.
static void SetRoadTypes(TileIndex t, RoadTypes rt)
Set the present road types of a tile.
Axis
Allow incrementing of DiagDirDiff variables.
static bool IsRoadDepot(TileIndex t)
Return whether a tile is a road depot.
The different types of rail.