71 bool IsPossibleDockingTile(
Tile t);
127 SB(t.
m1(), 5, 2, wc);
411 t.
m4() = random_bits;
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
constexpr T AssignBit(T &x, const uint8_t y, bool value)
Assigns a bit in a variable.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
Wrapper class to abstract away the way the tiles are stored.
debug_inline uint8_t & m7()
Primarily used for newgrf support.
debug_inline uint8_t & m5()
General purpose.
debug_inline uint8_t & m1()
Primarily used for ownership information.
debug_inline uint8_t & m4()
General purpose.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
debug_inline uint8_t & m6()
General purpose.
debug_inline uint8_t & m3()
General purpose.
Owner
Enum for all companies/owners.
@ OWNER_WATER
The tile/execution is done by "water".
Header files for depots (not hangars)
uint16_t DepotID
Type for the unique identifier of depots.
DiagDirection XYNSToDiagDir(Axis xy, uint ns)
Convert an axis and a flag for north/south into a DiagDirection.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirection
Enumeration for diagonal directions.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23)
TileIndexDiff TileOffsByAxis(Axis axis)
Convert an Axis to a TileIndexDiff.
TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
int32_t TileIndexDiff
An offset value between two tiles.
Map writing/reading functions for tiles.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
Owner GetTileOwner(Tile tile)
Returns the owner of a tile.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
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.
@ MP_TREES
Tile got trees.
@ MP_STATION
A tile of a station.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
@ MP_INDUSTRY
Part of an industry.
@ MP_OBJECT
Contains objects such as transmitters and owned land.
void MakeShore(Tile t)
Helper function to make a coast tile.
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
bool HasTileWaterGround(Tile t)
Checks whether the tile has water at the ground.
TileIndex GetShipDepotNorthTile(Tile t)
Get the most northern tile of a ship depot.
void MakeLock(Tile t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
Make a water lock.
void MakeWater(Tile t, Owner o, WaterClass wc, uint8_t random_bits)
Helper function for making a watery tile.
DepotPart GetShipDepotPart(Tile t)
Get the part of a ship depot.
bool IsTileOnWater(Tile t)
Tests if the tile was built on water.
DepotPart
Sections of the water depot.
@ DEPOT_PART_NORTH
Northern part of a depot.
@ DEPOT_PART_SOUTH
Southern part of a depot.
bool IsShipDepot(Tile t)
Is it a water tile with a ship depot on it?
bool IsValidWaterClass(WaterClass wc)
Checks if a water class is valid.
static constexpr uint8_t WBL_LOCK_PART_BEGIN
Start of lock part bitfield.
bool IsRiver(Tile t)
Is it a river water tile?
DiagDirection GetLockDirection(Tile t)
Get the direction of the water lock.
static constexpr uint8_t WBL_TYPE_COUNT
Length of the 'type' bitfield.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
@ WATER_CLASS_CANAL
Canal.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
@ WATER_CLASS_RIVER
River.
static constexpr uint8_t WBL_LOCK_ORIENT_BEGIN
Start of lock orientation bitfield.
void MakeLockTile(Tile t, Owner o, LockPart part, DiagDirection dir, WaterClass original_water_class)
Make a lock section.
bool HasTileWaterClass(Tile t)
Checks whether the tile has an waterclass associated.
bool IsShipDepotTile(Tile t)
Is it a ship depot tile?
bool IsCanal(Tile t)
Is it a canal tile?
static constexpr uint8_t WBL_TYPE_BEGIN
Bit field layout of m5 for water tiles.
bool IsCoast(Tile t)
Is it a coast tile?
void MakeRiver(Tile t, uint8_t random_bits)
Make a river tile.
WaterTileType GetWaterTileType(Tile t)
Get the water tile type of a tile.
void SetNonFloodingWaterTile(Tile t, bool b)
Set the non-flooding water tile state of a tile.
void SetWaterTileType(Tile t, WaterTileType type)
Set the water tile type of a tile.
WaterTileType
Available water tile types.
@ WATER_TILE_LOCK
Water lock.
@ WATER_TILE_DEPOT
Water Depot.
@ WATER_TILE_CLEAR
Plain water.
WaterClass GetWaterClass(Tile t)
Get the water class at a tile.
static constexpr uint8_t WBL_LOCK_ORIENT_COUNT
Length of lock orientation bitfield.
void MakeCanal(Tile t, Owner o, uint8_t random_bits)
Make a canal tile.
static constexpr uint8_t WBL_DEPOT_AXIS
Depot axis flag.
bool IsCoastTile(Tile t)
Is it a coast tile.
uint8_t GetLockPart(Tile t)
Get the part of a lock.
static constexpr uint8_t WBL_DEPOT_PART
Depot part flag.
TileIndex GetOtherShipDepotTile(Tile t)
Get the other tile of the ship depot.
bool IsDockingTile(Tile t)
Checks whether the tile is marked as a dockling tile.
bool IsNonFloodingWaterTile(Tile t)
Checks whether the tile is marked as a non-flooding water tile.
void SetDockingTile(Tile t, bool b)
Set the docking tile state of a tile.
bool IsWater(Tile t)
Is it a plain water tile?
bool IsWaterTile(Tile t)
Is it a water tile with plain water?
bool IsLock(Tile t)
Is there a lock on a given water tile?
void MakeShipDepot(Tile t, Owner o, DepotID did, DepotPart part, Axis a, WaterClass original_water_class)
Make a ship depot section.
uint8_t GetWaterTileRandomBits(Tile t)
Get the random bits of the water tile.
void MakeSea(Tile t)
Make a sea tile.
DiagDirection GetShipDepotDirection(Tile t)
Get the direction of the ship depot.
bool IsSea(Tile t)
Is it a sea water tile?
LockPart
Sections of the water lock.
@ LOCK_PART_UPPER
Upper part of a lock.
@ LOCK_PART_MIDDLE
Middle part of a lock.
@ LOCK_PART_LOWER
Lower part of a lock.
static constexpr uint8_t WBL_LOCK_PART_COUNT
Length of lock part bitfield.
Axis GetShipDepotAxis(Tile t)
Get the axis of the ship depot.