#pragma once

#include "Infrastructure\Vector2.h"
#include "MultiTouchManager.h"
#include "Input\MouseInput.h"

#include <list>

class Touchable;
class MultiSelectionCircle;
class Bacterium;

class CellWarsMTManager : public MultiTouchManager, public MouseListener
{
public:
	CellWarsMTManager();
	virtual ~CellWarsMTManager();
	
	virtual void removeTuioCursorWithoutTouchable(std::list<Vector2> *path);

	virtual void removeTouchableFromCursorMap(Touchable* remThis);
	virtual void removeSelectedBacteriumFromSelectionCircles(Bacterium* remBact);
	virtual void removeMultiSelectionCircle(MultiSelectionCircle* remMTCircle);
	
	virtual void update(float dt);
	virtual void render();

	std::list<MultiSelectionCircle*>* getSelectionCircleList(){return selectionCircleList;}
	
	virtual void MouseMotionEvent(Vec2i screenCoordinates);
	virtual void MouseDownEvent(Vec2i screenCoordinates, MouseButtonInput button);
	virtual void MouseUpEvent(Vec2i screenCoordinates, MouseButtonInput button);
	virtual void MouseWheelEvent(int position);
	std::list<Vector2>* mMousePath;
	Vector2 mCursorPos;
	Vec2i limitMousePosToScreen(Vec2i screenCoordinates);
	Vec2i mousePosBorderOffset;
	float timeSinceLastMouseEvent;
	Actor* mouseCursor;
	
protected:
	static const float MAX_DIST_SELECTION_CIRCLE_START_TO_END;
	static const int MOUSE_CURSOR_ID;
	static const float TIME_UNTIL_MOUSE_FADE;

private:
	std::list<MultiSelectionCircle*> *selectionCircleList;
};