|
@@ -39,34 +39,34 @@ struct GenericScopeResolver : public Sco
|
|
|
GenericScopeResolver(ResolverObject &ro, bool ai_callback)
|
|
|
: ScopeResolver(ro), cargo_type(0), default_selection(0), src_industry(0), dst_industry(0), distance(0),
|
|
|
event(), count(0), station_size(0), ai_callback(ai_callback)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
|
|
|
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
|
|
|
|
|
|
private:
|
|
|
bool ai_callback; ///< Callback comes from the AI.
|
|
|
};
|
|
|
|
|
|
|
|
|
/** Resolver object for generic objects/properties. */
|
|
|
struct GenericResolverObject : public ResolverObject {
|
|
|
GenericScopeResolver generic_scope;
|
|
|
|
|
|
GenericResolverObject(bool ai_callback, CallbackID callback = CBID_NO_CALLBACK);
|
|
|
|
|
|
/* 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->generic_scope;
|
|
|
default: return ResolverObject::GetScope(scope, relative);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
|
|
|
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
|
|
|
};
|
|
|
|
|
|
struct GenericCallback {
|
|
|
const GRFFile *file;
|
|
|
const SpriteGroup *group;
|
|
|
|