33 uint32_t
GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter,
bool &available)
const override;
87 uint32_t connectivity =
103 Debug(grf, 1,
"Unhandled canal variable 0x{:02X}", variable);
116 return this->feature;
128 CallbackID callback, uint32_t callback_param1, uint32_t callback_param2)
129 :
ResolverObject(
_water_feature[feature].grffile, callback, callback_param1, callback_param2), canal_scope(*this, tile), feature(feature)
144 if (group ==
nullptr)
return 0;
146 return group->GetResult();
161 return object.ResolveCallback();
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
Functions related to debugging.
#define Debug(category, level, format_string,...)
Ouptut a line of debugging information.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
TileIndex TileAddXY(TileIndex tile, int x, int y)
Adds a given offset to a tile.
CanalFeature
List of different canal 'features'.
CallbackID
List of implemented NewGRF callbacks.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
@ CBID_CANALS_SPRITE_OFFSET
Add an offset to the default sprite numbers to show another sprite.
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
@ CBM_CANAL_SPRITE_OFFSET
Enable add sprite offset callback.
static uint16_t GetCanalCallback(CallbackID callback, uint32_t param1, uint32_t param2, CanalFeature feature, TileIndex tile)
Run a specific callback for canals.
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset)
Get the new sprite offset for a water tile.
WaterFeature _water_feature[CF_END]
Table of canal 'feature' sprite groups.
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile)
Lookup the base sprite to use for a canal.
Handling of NewGRF canals.
uint32_t GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
@ VSG_SCOPE_SELF
Resolved object itself.
A number of safeguards to prevent using unsafe methods.
Functions to cache sprites in memory.
Definition of base types and functions in a cross-platform compatible way.
Resolver object for canals.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
CanalResolverObject(CanalFeature feature, TileIndex tile, CallbackID callback=CBID_NO_CALLBACK, uint32_t callback_param1=0, uint32_t callback_param2=0)
Canal resolver constructor.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
Scope resolver of a canal tile.
uint32_t GetRandomBits() const override
Get a few random bits.
uint32_t GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const override
Get a variable value.
TileIndex tile
Tile containing the canal.
Interface for SpriteGroup-s to access the gamestate.
uint32_t callback_param2
Second parameter (var 18) of the callback.
CallbackID callback
Callback being resolved.
uint32_t callback_param1
First parameter (var 10) of the callback.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0)
Get a resolver for the scope.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ResolverObject & ro
Surrounding resolver object.
virtual const SpriteGroup * Resolve([[maybe_unused]] ResolverObject &object) const
Base sprite group resolver.
Information about a water feature.
const SpriteGroup * group
Sprite group to start resolving.
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
Functions related to water (management)
bool IsWateredTile(TileIndex tile, Direction from)
return true if a tile is a water tile wrt.
Map accessors for water tiles.
uint8_t GetLockPart(Tile t)
Get the part of a lock.
bool IsLock(Tile t)
Is there a lock on a given water tile?
uint8_t GetWaterTileRandomBits(Tile t)
Get the random bits of the water tile.
@ LOCK_PART_UPPER
Upper part of a lock.