85 default: NOT_REACHED();
109 return (WaterClass)
GB(
_m[t].m1, 5, 2);
121 SB(
_m[t].m1, 5, 2, wc);
288 return t < tile2 ? t : tile2;
363 SB(
_me[t].m6, 2, 4, 0);
381 _m[t].
m4 = random_bits;
383 SB(
_me[t].m6, 2, 4, 0);
436 SB(
_me[t].m6, 2, 4, 0);
458 SB(
_me[t].m6, 2, 4, 0);
Helper template class that makes basic properties of given enumeration type visible from outsize...
uint16 DepotID
Type for the unique identifier of depots.
static byte GetLockPart(TileIndex t)
Get the part of a lock.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
static Axis GetShipDepotAxis(TileIndex t)
Get the axis of the ship depot.
LockPart
Sections of the water lock.
int32 TileIndexDiff
An offset value between to tiles.
static bool IsWater(TileIndex t)
Is it a plain water tile?
static WaterClass GetWaterClass(TileIndex t)
Get the water class at a tile.
static TileIndex GetShipDepotNorthTile(TileIndex t)
Get the most northern tile of a ship depot.
Lock ('type' bitfield).
byte m7
Primarily used for newgrf support.
uint16 m2
Primarily used for indices to towns, industries and stations.
static void MakeShore(TileIndex t)
Helper function to make a coast tile.
Tile * _m
Tiles of the map.
WaterTileTypeBitLayout
Bit field layout of m5 for water tiles.
static TileIndex GetOtherShipDepotTile(TileIndex t)
Get the other tile of the ship depot.
static bool HasTileWaterGround(TileIndex t)
Checks whether the tile has water at the ground.
Clear water or coast ('type' bitfield).
Contains objects such as transmitters and owned land.
Length of the 'type' bitfield.
static void SetWaterClass(TileIndex t, WaterClass wc)
Set the water class at a tile.
Length of lock orientiation bitfield.
Depot ('type' bitfield).
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.
static bool IsLock(TileIndex t)
Is there a lock on a given water tile?
Header files for depots (not hangars)
static void MakeSea(TileIndex t)
Make a sea tile.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
static bool IsCoast(TileIndex t)
Is it a coast tile?
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
static byte GetWaterTileRandomBits(TileIndex t)
Get the random bits of the water tile.
Informative template class exposing basic enumeration properties used by several other templates belo...
TileExtended * _me
Extended Tiles of the map.
static WaterTileType GetWaterTileType(TileIndex t)
Get the water tile type at a tile.
DiagDirection
Enumeration for diagonal directions.
static void MakeLockTile(TileIndex t, Owner o, LockPart part, DiagDirection dir, WaterClass original_water_class)
Make a lock section.
static bool IsWaterTile(TileIndex t)
Is it a water tile with plain water?
static bool IsShipDepotTile(TileIndex t)
Is it a ship depot tile?
static void MakeRiver(TileIndex t, uint8 random_bits)
Make a river tile.
static void MakeShipDepot(TileIndex t, Owner o, DepotID did, DepotPart part, Axis a, WaterClass original_water_class)
Make a ship depot section.
static bool IsSea(TileIndex t)
Is it a sea water tile?
Length of lock part bitfield.
Northern part of a depot.
static DiagDirection GetShipDepotDirection(TileIndex t)
Get the direction of the ship depot.
static DiagDirection XYNSToDiagDir(Axis xy, uint ns)
Convert an axis and a flag for north/south into a DiagDirection.
static DiagDirection GetLockDirection(TileIndex t)
Get the direction of the water lock.
static bool IsShipDepot(TileIndex t)
Is it a water tile with a ship depot on it?
uint32 TileIndex
The index/ID of a Tile.
DepotPart
Sections of the water depot.
static void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
Make a water lock.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static bool IsCanal(TileIndex t)
Is it a canal tile?
static void SetTileType(TileIndex tile, TileType type)
Set the type of a tile.
Southern part of a depot.
static bool IsRiver(TileIndex t)
Is it a river water tile?
static void MakeWater(TileIndex t, Owner o, WaterClass wc, uint8 random_bits)
Helper function for making a watery tile.
static void MakeCanal(TileIndex t, Owner o, uint8 random_bits)
Make a canal tile.
Start of lock part bitfield.
static bool IsCoastTile(TileIndex t)
Is it a coast tile.
static TileIndexDiff TileDiffXY(int x, int y)
Calculates an offset for the given coordinate(-offset).
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static bool HasTileWaterClass(TileIndex t)
Checks whether the tile has an waterclass associated.
Start of lock orientiation bitfield.
Start of the 'type' bitfield.
Map writing/reading functions for tiles.
Owner
Enum for all companies/owners.
WaterTileType
Available water tile types.
static bool IsTileOnWater(TileIndex t)
Tests if the tile was built on water.
The tile/execution is done by "water".
Axis
Allow incrementing of DiagDirDiff variables.
Used for industry tiles on land (also for oilrig if newgrf says so).
static DepotPart GetShipDepotPart(TileIndex t)
Get the part of a ship depot.