|
@@ -107,38 +107,38 @@ struct ObjectScopeResolver : public Scop
|
|
|
/**
|
|
|
* Constructor of an object scope resolver.
|
|
|
* @param ro Surrounding resolver.
|
|
|
* @param obj Object being resolved.
|
|
|
* @param tile %Tile of the object.
|
|
|
* @param view View of the object.
|
|
|
*/
|
|
|
ObjectScopeResolver(ResolverObject &ro, Object *obj, TileIndex tile, uint8 view = 0)
|
|
|
: ScopeResolver(ro), obj(obj), tile(tile), view(view)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
/* 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;
|
|
|
};
|
|
|
|
|
|
/** A resolver object to be used with feature 0F spritegroups. */
|
|
|
struct ObjectResolverObject : public ResolverObject {
|
|
|
ObjectScopeResolver object_scope; ///< The object scope resolver.
|
|
|
TownScopeResolver *town_scope; ///< The town scope resolver (created on the first call).
|
|
|
|
|
|
ObjectResolverObject(const ObjectSpec *spec, Object *o, TileIndex tile, uint8 view = 0,
|
|
|
CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0);
|
|
|
~ObjectResolverObject();
|
|
|
|
|
|
/* 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->object_scope;
|
|
|
|
|
|
case VSG_SCOPE_PARENT: {
|
|
|
TownScopeResolver *tsr = this->GetTown();
|
|
|
if (tsr != NULL) return tsr;
|
|
|
FALLTHROUGH;
|
|
|
}
|
|
|
|
|
|
default:
|