OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
86 return GB(t.
m5(), 0, 2);
123 return GB(t.
m5(), 5, 3);
161 t.
m5() = 0 << 5 | type << 2 | density;
174 return GB(t.
m3(), 0, 4);
198 return(IndustryID) t.
m2();
225 default: NOT_REACHED();
244 default: NOT_REACHED();
266 t.
m4() = 0 << 5 | 0 << 2;
287 t.
m4() = 0 << 5 | 0 << 2;
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
bool IsClearGround(Tile t, ClearGround ct)
Set the type of clear tile.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
debug_inline uint8_t & m5()
General purpose.
debug_inline uint8_t & m3()
General purpose.
void MakeSnow(Tile t, uint density=0)
Make a snow tile.
void SetClearCounter(Tile t, uint c)
Sets the counter used to advance to the next clear density/field type.
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.
void AddClearDensity(Tile t, int d)
Increment the density of a non-field clear tile.
debug_inline uint16_t & m8()
General purpose.
DiagDirection
Enumeration for diagonal directions.
Wrapper class to abstract away the way the tiles are stored.
uint GetFieldType(Tile t)
Get the field type (production stage) of the field.
debug_inline uint8_t & m4()
General purpose.
debug_inline uint8_t & m7()
Primarily used for newgrf support.
void MakeClear(Tile t, ClearGround g, uint density)
Make a clear tile.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
void SetClearDensity(Tile t, uint d)
Set the density of a non-field clear tile.
uint GetClearCounter(Tile t)
Get the counter used to advance to the next clear density/field type.
@ OWNER_NONE
The tile has no ownership.
void SetFence(Tile t, DiagDirection side, uint h)
Sets the type of fence (and whether there is one) for the given border.
ClearGround GetRawClearGround(Tile t)
Get the type of clear tile but never return CLEAR_SNOW.
ClearGround GetClearGround(Tile t)
Get the type of clear tile.
debug_inline uint8_t & m6()
General purpose.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
void MakeField(Tile t, uint field_type, IndustryID industry)
Make a (farm) field tile.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
void SetFieldType(Tile t, uint f)
Set the field type (production stage) of the field.
void SetClearGroundDensity(Tile t, ClearGround type, uint density)
Sets ground type and density in one go, also sets the counter to 0.
bool IsSnowTile(Tile t)
Test if a tile is covered with snow.
void SetIndustryIndexOfField(Tile t, IndustryID i)
Set the industry (farm) that made the field.
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.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
uint GetFence(Tile t, DiagDirection side)
Is there a fence at the given border?
constexpr T ClrBit(T &x, const uint8_t y)
Clears a bit in a variable.
void AddClearCounter(Tile t, int c)
Increments the counter used to advance to the next clear density/field type.
IndustryID GetIndustryIndexOfField(Tile t)
Get the industry (farm) that made the field.
uint GetClearDensity(Tile t)
Get the density of a non-field clear tile.
debug_inline uint8_t & m1()
Primarily used for ownership information.
void ClearSnow(Tile t)
Clear the snow from a tile and return it to its previous type.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.