OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
33 uint32
GetVariable(
byte variable, uint32 parameter,
bool *available)
const override;
103 Debug(grf, 1,
"Unhandled canal variable 0x{:02X}", variable);
116 return this->feature;
128 CallbackID callback, uint32 callback_param1, uint32 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();
Resolver object for canals.
@ LOCK_PART_UPPER
Upper part of a lock.
uint32 TileIndex
The index/ID of a Tile.
uint32 callback_param1
First parameter (var 10) of the callback.
Information about a water feature.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
CanalResolverObject(CanalFeature feature, TileIndex tile, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Canal resolver constructor.
@ CBID_CANALS_SPRITE_OFFSET
Add an offset to the default sprite numbers to show another sprite.
Interface for SpriteGroup-s to access the gamestate.
static uint16 GetCanalCallback(CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile)
Run a specific callback for canals.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset)
Get the new sprite offset for a water tile.
CallbackID
List of implemented NewGRF callbacks.
@ CBM_CANAL_SPRITE_OFFSET
Enable add sprite offset callback.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
@ VSG_SCOPE_SELF
Resolved object itself.
static byte GetLockPart(TileIndex t)
Get the part of a lock.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
uint32 callback_param2
Second parameter (var 18) of the callback.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
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.
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.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
uint32 GetRandomBits() const override
Get a few random bits.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
TileIndex tile
Tile containing the canal.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
Scope resolver of a canal tile.
static byte GetWaterTileRandomBits(TileIndex t)
Get the random bits of the water tile.
CallbackID callback
Callback being resolved.
static bool IsLock(TileIndex t)
Is there a lock on a given water tile?
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
#define TILE_ADDXY(tile, x, y)
Adds a given offset to a tile.
#define Debug(name, level, format_string,...)
Ouptut a line of debugging information.
ResolverObject & ro
Surrounding resolver object.
uint32 GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
const SpriteGroup * group
Sprite group to start resolving.
CanalFeature
List of different canal 'features'.