//	Player.h - The player's deflector thing.
//  ----------------------------------------------------------------------------
//	This file is part of 'GameTemplate', template code for a game.
//	Copyright (C) 2011  Niall Moody
//	
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
//	----------------------------------------------------------------------------

#ifndef PLAYER_H_
#define PLAYER_H_

#include "TwoFloats.h"
#include "c0xHeaders.h"

#include <stdint.h>

class Drawer;
typedef shared_ptr<Drawer> DrawerPtr;

///	The player's deflector thing.
class Player
{
  public:
	///	Constructor.
	Player();
	///	Destructor.
	~Player();

	///	Draws the player.
	void draw(DrawerPtr& d);

	///	Moves the deflector.
	void mouseMove(const TwoFloats& pos);
	///	Deflects/attracts sine dots.
	void mouseDown(int button);
	///	Stops deflecting/attracting sine dots.
	void mouseUp(int button);

	///	Returns the deflector's position.
	const TwoFloats& getPosition() const {return position;};
	///	Returns true if the deflector is deflecting.
	bool getDeflecting() const {return deflecting;};
	///	Returns true if the deflector is attracting.
	bool getAttracting() const {return attracting;};
  private:
	///	The deflector's position.
	TwoFloats position;

	///	Whether the deflector's currently deflecting or not.
	bool deflecting;
	///	Whether the deflector's currently attracting or not.
	bool attracting;
	///	Used to scale the deflector image with a sine wave.
	float deflectScale;
};

#endif
