#include "stdafx.h"
#include "Touchable.h"

#include "MultiTouchManager.h"

Touchable::Touchable(MultiTouchManager *useThisMultiTouchManager) : 
fingerToThisOffset(), priorityLevelBackup(0), numFingersOnThis(0), 
	priorityLevel(0), useThisMTManager(useThisMultiTouchManager)
{
	useThisMTManager->addTouchableToCallbackList(this);
}

Touchable::Touchable() : 
fingerToThisOffset(), priorityLevelBackup(0), numFingersOnThis(0), 
	priorityLevel(0), useThisMTManager(NULL)
{
	useThisMTManager->addTouchableToCallbackList(this);
}

Touchable::~Touchable()
{
	useThisMTManager->removeTouchableFromCallbackList(this);
}

void Touchable::fingerDown(Vector2 posDownInAngelCoords)
{
	//std::cout << "finger down on " << belongsToThisActor->GetName() << std::endl;
	++numFingersOnThis;

	fingerToThisOffset = posDownInAngelCoords - GetPosition();
}

void Touchable::fingerMove(Vector2 moveToInAngelCoords)
{

}

void Touchable::fingerUp(Vector2 lastPosInAngelCoords)
{
	//std::cout << "finger up from " << belongsToThisActor->GetName() << std::endl;
	--numFingersOnThis;
}
