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