|
@@ -27,32 +27,32 @@ struct CanalScopeResolver : public Scope
|
|
|
|
|
|
CanalScopeResolver(ResolverObject &ro, TileIndex tile)
|
|
|
: ScopeResolver(ro), tile(tile)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
/* virtual */ uint32 GetRandomBits() const;
|
|
|
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
|
|
|
uint32 GetRandomBits() const override;
|
|
|
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
|
|
|
};
|
|
|
|
|
|
/** Resolver object for canals. */
|
|
|
struct CanalResolverObject : public ResolverObject {
|
|
|
CanalScopeResolver canal_scope;
|
|
|
|
|
|
CanalResolverObject(CanalFeature feature, TileIndex tile,
|
|
|
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
|
|
|
|
|
|
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
|
|
|
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
|
|
|
{
|
|
|
switch (scope) {
|
|
|
case VSG_SCOPE_SELF: return &this->canal_scope;
|
|
|
default: return ResolverObject::GetScope(scope, relative);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
|
|
|
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
|
|
|
};
|
|
|
|
|
|
/* virtual */ uint32 CanalScopeResolver::GetRandomBits() const
|
|
|
{
|
|
|
/* Return random bits only for water tiles, not station tiles */
|
|
|
return IsTileType(this->tile, MP_WATER) ? GetWaterTileRandomBits(this->tile) : 0;
|