#pragma once
#include "Infrastructure\Vector2.h"
#include "Actors\Actor.h"

class MultiTouchManager;

class Touchable : public virtual Actor
{
public:
	Touchable(MultiTouchManager *useThisMultiTouchManager);
	virtual ~Touchable();
	
	virtual void fingerDown(Vector2 posDownInAngelCoords);
	virtual void fingerMove(Vector2 moveToInAngelCoords);
	virtual void fingerUp(Vector2 lastPosInAngelCoords);
	
	void setInactive(){ 
		if (priorityLevel > -1) 
			priorityLevelBackup = priorityLevel;
		priorityLevel = -1;
	}
	void setActive(){priorityLevel = priorityLevelBackup;}
	void setPriorityLevel(int newPrioLevel)
	{
		priorityLevel = newPrioLevel; 
		priorityLevelBackup = newPrioLevel;
	}
	int getPriorityLevel(){return priorityLevel;}

	bool isAlreadyTouched(){return (numFingersOnThis > 0);}

protected:
	Vector2 fingerToThisOffset;
	int numFingersOnThis;

private:
	Touchable();
	MultiTouchManager *useThisMTManager;

	int priorityLevel;
	int priorityLevelBackup;
};