#ifndef _RUCONTROLLER_MATERIALTEXTURE_H_
#define _RUCONTROLLER_MATERIALTEXTURE_H_

#include "../../Scene/Base/RuEntityBase.h"

#pragma unmanaged

// ************************************************************************************************************************************************************

/*!
	@author John Tang
	@version 2004/12/10
*/
class CRuController_MaterialTexture : public IRuEntity_Controller
{
	ruRTTI_DECLARE
	ruHEAP_DECLARE
	ruCLASSGUID_DECLARE

protected:
	IRuMaterial*							m_targetMaterial;

	CRuArrayList<IRuBaseTexture *>			m_textureList;
	INT32									m_curTextureIndex;
	REAL									m_frameRate;
	REAL									m_tDelta;
	RuTextureChannel						m_targetChannel;

public:
											CRuController_MaterialTexture();
	virtual									~CRuController_MaterialTexture();

	// Base interface
	virtual BOOL							Update(REAL elapsedTime);

	virtual IRuObject*						GetTarget();
	virtual BOOL							SetTarget(IRuObject *target);

	void									SetTargetChannel(RuTextureChannel targetChannel);
	BOOL									AddTexture(IRuBaseTexture *texture);

	// IRuEntityEventListener implementation
	virtual BOOL							HandleEvent(CRuEntity *entity, INT32 eventID, INT32 eventParameter0, INT32 eventParameter1, const char *eventString, REAL eventDuration, void *userData);
};

// ************************************************************************************************************************************************************

#pragma managed

#endif
