#ifndef _sprite_h
#define _sprite_h

#include <qcanvas.h>

class Sprite
{
public:
	Sprite(int id, int x, int y, QCanvasSprite* sprite);
	virtual ~Sprite(void);
	
	/**
	 * is called when QTimer timed out
	 **/
	virtual void proceed();

	/**
	 * returns the pointer to QCanvasSprite
	 **/
	QCanvasSprite* sprite(void);

	/**
	 * set sprite explicitely
	 **/
	void setSprite(QCanvasPixmapArray *a);

	/**
	 * returns x-coordinate of the item
	 **/
	int x(void);

	/**
	 * returns y-coordinate of the item
	 **/
	int y(void);

	/**
	 * set x-coordinate of the item
	 **/
	void move(int x, int y);

	/**
	 * set time counter of item
	 **/
	void setStep(int step);

	/**
	 * returns true if item has done it's work
	 **/
	virtual int finished(void);

	int id();

	static void setTilesize(int tilesize);

protected:
	int m_step;
	bool m_finished;

	QCanvasSprite* m_sprite;

private:
	int m_x, m_y;
	int m_id;
	static int m_tilesize;
};

#endif
