//	Capitalist.h - The capitalist class.
//  ----------------------------------------------------------------------------
//	This file is part of 'The Future Will Only Be Dystopian if Capitalism
//	Remains Undefeated', a game.
//	Copyright (C) 2009  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 CAPITALIST_H_
#define CAPITALIST_H_

#include <stdint.h>

class Drawer;
class GamePlay;

///	The capitalist class.
class Capitalist
{
  public:
	///	Constructor.
	Capitalist();
	///	Destructor.
	~Capitalist();

	///	Moves the capitalist.
	void move();
	///	Draws the capitalist.
	void draw(Drawer *d);

	///	Sets the capitalist's position.
	void setPosition(int x, int y);
	///	Returns the capitalist's position.
	float getX() const {return (float)xPos;};
	///	Returns the capitalist's position.
	float getY() const {return (float)yPos;};

	///	Reduces the capitalist's life.
	/*!
		\param val The amount to reduce the capitalist's life by.
		\param x The direction vector to move the capitalist.
		\param y The direction vector to move the capitalist.
		\return true if the capitalist was killed.
	 */
	bool reduceLife(float val, float x, float y);
	///	Returns the capitalist's life.
	float getLife() const {return life;};
	///	Regenerates the capitalist's life.
	void regenerate();

	///	Sets the owning GamePlay object.
	void setGamePlay(GamePlay *gp);
  private:
	///	The capitalist's image.
	static uint32_t image;

	///	The capitalist's position.
	float xPos;
	///	The capitalist's position.
	float yPos;
	///	The direction the capitalist's moving in (if at all).
	float xDir;
	///	The direction the capitalist's moving in (if at all).
	float yDir;
	///	The inertia of the capitalist while it's moving.
	float inertia;
	///	When to add debilitation waves to the world.
	int waveCount;
	///	This capitalist's life.
	float life;

	///	Used to add debilitation waves to the world.
	GamePlay *gamePlay;
};

#endif
