79 return GB(t.
m5(), 0, 2);
116 return GB(t.
m5(), 5, 3);
167 return GB(t.
m3(), 0, 4);
191 return(IndustryID) t.
m2();
218 default: NOT_REACHED();
237 default: NOT_REACHED();
259 t.
m4() = 0 << 5 | 0 << 2;
278 t.
m2() = industry.base();
280 t.
m4() = 0 << 5 | 0 << 2;
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 constexpr uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
constexpr bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
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.
uint8_t & m5()
General purpose.
uint8_t & m1()
Primarily used for ownership information.
uint8_t & m4()
General purpose.
uint8_t & m6()
General purpose.
uint8_t & m7()
Primarily used for newgrf support.
uint8_t & m3()
General purpose.
uint16_t & m8()
General purpose.
uint16_t & m2()
Primarily used for indices to towns, industries and stations.
void SetFieldType(Tile t, uint f)
Set the field type (production stage) of the field.
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.
@ Desert
Desert with transition (1,3).
@ MaxSize
The maximum possible number of clear ground types to be stored in map.
@ Rocks
Rocks with snow transition (0-3).
@ Grass
Plain grass with dirt transition (0-3).
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.
static constexpr size_t CLEAR_GROUND_BITS
How many bits in map array are dedicated for clear ground type.
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.
static constexpr Owner OWNER_NONE
The tile has no ownership.
DiagDirection
Enumeration for diagonal directions.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23).
Types related to the industry.
static bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
@ Clear
A tile without any structures, i.e. grass, rocks, farm fields etc.