File diff r22755:0cb1ea35844a → r22756:8ffd1846f871
src/newgrf_spritegroup.h
Show inline comments
 
@@ -285,14 +285,14 @@ struct IndustryProductionSpriteGroup : S
 
 * Multiple of these interfaces are combined into a #ResolverObject to allow access
 
 * to different game entities from a #SpriteGroup-chain (action 1-2-3 chain).
 
 */
 
struct ScopeResolver {
 
	ResolverObject &ro; ///< Surrounding resolver object.
 

	
 
	ScopeResolver(ResolverObject &ro);
 
	virtual ~ScopeResolver();
 
	ScopeResolver(ResolverObject &ro) : ro(ro) {}
 
	virtual ~ScopeResolver() {}
 

	
 
	virtual uint32 GetRandomBits() const;
 
	virtual uint32 GetTriggers() const;
 

	
 
	virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
 
	virtual void StorePSA(uint reg, int32 value);
 
@@ -302,14 +302,26 @@ struct ScopeResolver {
 
 * Interface for #SpriteGroup-s to access the gamestate.
 
 *
 
 * Using this interface #SpriteGroup-chains (action 1-2-3 chains) can be resolved,
 
 * to get the results of callbacks, rerandomisations or normal sprite lookups.
 
 */
 
struct ResolverObject {
 
	ResolverObject(const GRFFile *grffile, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
 
	virtual ~ResolverObject();
 
	/**
 
	 * Resolver constructor.
 
	 * @param grffile NewGRF file associated with the object (or \c NULL if none).
 
	 * @param callback Callback code being resolved (default value is #CBID_NO_CALLBACK).
 
	 * @param callback_param1 First parameter (var 10) of the callback (only used when \a callback is also set).
 
	 * @param callback_param2 Second parameter (var 18) of the callback (only used when \a callback is also set).
 
	 */
 
	ResolverObject(const GRFFile *grffile, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0)
 
		: default_scope(*this), callback(callback), callback_param1(callback_param1), callback_param2(callback_param2), grffile(grffile), root_spritegroup(NULL)
 
	{
 
		this->ResetState();
 
	}
 

	
 
	virtual ~ResolverObject() {}
 

	
 
	ScopeResolver default_scope; ///< Default implementation of the grf scope.
 

	
 
	CallbackID callback;        ///< Callback being resolved.
 
	uint32 callback_param1;     ///< First parameter (var 10) of the callback.
 
	uint32 callback_param2;     ///< Second parameter (var 18) of the callback.