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;
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
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 T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
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.
constexpr T ClrBit(T &x, const uint8_t y)
Clears a bit in a variable.
Map accessor functions for bridges.
Wrapper class to abstract away the way the tiles are stored.
debug_inline uint16_t & m8()
General purpose.
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.
void SetFieldType(Tile t, uint f)
Set the field type (production stage) of the field.
ClearGround GetRawClearGround(Tile t)
Get the type of clear tile but never return CLEAR_SNOW.
void AddClearCounter(Tile t, int c)
Increments the counter used to advance to the next clear density/field type.
uint GetFieldType(Tile t)
Get the field type (production stage) of the field.
void AddClearDensity(Tile t, int d)
Increment the density of a non-field clear tile.
void SetClearDensity(Tile t, uint d)
Set the density of a non-field clear tile.
void ClearSnow(Tile t)
Clear the snow from a tile and return it to its previous type.
bool IsClearGround(Tile t, ClearGround ct)
Set the type of clear tile.
void MakeSnow(Tile t, uint density=0)
Make a snow tile.
void SetFence(Tile t, DiagDirection side, uint h)
Sets the type of fence (and whether there is one) for the given border.
IndustryID GetIndustryIndexOfField(Tile t)
Get the industry (farm) that made the field.
void MakeClear(Tile t, ClearGround g, uint density)
Make a clear tile.
ClearGround GetClearGround(Tile t)
Get the type of clear tile.
void SetIndustryIndexOfField(Tile t, IndustryID i)
Set the industry (farm) that made the field.
void MakeField(Tile t, uint field_type, IndustryID industry)
Make a (farm) field tile.
void SetClearCounter(Tile t, uint c)
Sets the counter used to advance to the next clear density/field type.
void SetClearGroundDensity(Tile t, ClearGround type, uint density)
Sets ground type and density in one go, also sets the counter to 0.
uint GetFence(Tile t, DiagDirection side)
Is there a fence at the given border?
uint GetClearCounter(Tile t)
Get the counter used to advance to the next clear density/field type.
bool IsSnowTile(Tile t)
Test if a tile is covered with snow.
uint GetClearDensity(Tile t)
Get the density of a non-field clear tile.
@ OWNER_NONE
The tile has no ownership.
DiagDirection
Enumeration for diagonal directions.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
Types related to the industry.
void SetTileType(Tile tile, TileType type)
Set the type 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.
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.