#include "vector.h"
#include "bullet.h"

#ifndef TANK_H
#define TANK_H

class Tank
{
public:
	// Constructors
	Tank();
	Tank(const Vector& _loc);
	~Tank();

	// Display
	void draw() const;
	void drawBar() const;

	// Setters
	void setLoc(const Vector& newloc);
	void setColor(const Vector& col);
	void setTheta(double _theta);
	void setPhi(double _phi);

	// Getters
	Vector getLoc() const;
	double getTheta() const;
	double getPhi() const;
	int getPower() const;

	// State
	bool isAlive() const;
	void die();

	// Aim
	void rotateTheta(double theta);
	void rotatePhi(double phi);
	void powerUp();
	void powerDown();

	// Fire!
	Bullet* launch() const;

private:
	// Appearance
	double radius;
	Vector color;

	// State
	Vector loc;
	bool alive;

	// Aim
	double theta; // radians
	double phi;   // radians
	int power;

	double normalizeAngle(double& angle);
};

#endif // TANK_H