34 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const;
102 DEBUG(grf, 1,
"Unhandled canal variable 0x%02X", variable);
125 CallbackID callback, uint32 callback_param1, uint32 callback_param2)
126 :
ResolverObject(_water_feature[feature].grffile, callback, callback_param1, callback_param2), canal_scope(*this, tile)
141 if (group == NULL)
return 0;
143 return group->GetResult();
158 return object.ResolveCallback();
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope)...
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
static byte GetLockPart(TileIndex t)
Get the part of a lock.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
ResolverObject & ro
Surrounding resolver object.
Functions related to debugging.
Interface for SpriteGroup-s to access the gamestate.
uint32 GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile)
Lookup the base sprite to use for a canal.
CanalFeature
List of different canal 'features'.
Set when using the callback resolve system, but not to resolve a callback.
Enable add sprite offset callback.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
const SpriteGroup * ResolveReal(const RealSpriteGroup *group) const
Get the real sprites of the grf.
byte num_loaded
Number of loaded groups.
static bool IsLock(TileIndex t)
Is there a lock on a given water tile?
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
bool IsWateredTile(TileIndex tile, Direction from)
return true if a tile is a water tile wrt.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
const SpriteGroup ** loaded
List of loaded groups (can be SpriteIDs or Callback results)
Map accessors for water tiles.
Definition of base types and functions in a cross-platform compatible way.
CanalResolverObject(CanalFeature feature, TileIndex tile, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Canal resolver constructor.
static byte GetWaterTileRandomBits(TileIndex t)
Get the random bits of the water tile.
#define TILE_ADDXY(tile, x, y)
Adds a given offset to a tile.
A number of safeguards to prevent using unsafe methods.
Add an offset to the default sprite numbers to show another sprite.
const SpriteGroup * group
Sprite group to start resolving.
Scope resolver of a canal tile.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
WaterFeature _water_feature[CF_END]
Table of canal 'feature' sprite groups.
#define DEBUG(name, level,...)
Output a line of debugging information.
uint32 GetRandomBits() const
Get a few random bits.
Handling of NewGRF canals.
static uint16 GetCanalCallback(CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile)
Run a specific callback for canals.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
CallbackID callback
Callback being resolved.
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset)
Get the new sprite offset for a water tile.
TileIndex tile
Tile containing the canal.
CallbackID
List of implemented NewGRF callbacks.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
Functions related to water (management)
Resolver object for canals.
Information about a water feature.