//	Pickup.h - The collidable pickup class.
//  ----------------------------------------------------------------------------
//	This file is part of 'NiallsAVLib', base code for any kind of audiovisual
//	apps.
//	Copyright (C) 2012  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 Pickup_H_
#define Pickup_H_

#include "ThreeFloats.h"
#include "Collidable.h"
#include "c0xHeaders.h"

class Drawer;
class Tank;

///	The collidable pickup class.
class Pickup : public Collidable
{
  public:
	///	Constructor.
	Pickup(const TwoFloats& pos, const std::wstring& type);
	///	Destructor.
	~Pickup();

	///	Moves the Pickup.
	void update(const TwoFloats& arenaTopLeft,
			    const TwoFloats& arenaBottomRight);
	///	Draws the Pickup's top.
	void draw(shared_ptr<Drawer>& d,
			  float timestepInterp,
			  const ThreeFloats& leftCol,
			  const ThreeFloats& rightCol,
			  const ThreeFloats& borderCol);

	///	Returns which type of pickup this is.
	const std::wstring& getType() const {return pickupType;};
	///	Returns true if someone's collected this pickup.
	bool getCollected() const {return collected;};
	///	Returns the colour to display this pickup's announcement with.
	const ThreeFloats& getCollectorColour() {return collectorColour;};

	///	Makes it so the pickup can be collected by a bullet.
	void setBulletCollection();
	///	So we can draw the pickups as presents in December.
	void setDecember();

	///	Returns true if this entity wants to know when it collides with the named entity type.
	bool interestedInCollisionsWith(const std::wstring& entity) const;
	///	Called when this entity collides with another.
	bool collide(const shared_ptr<Collidable>& other,
				 GamePlayState& state);

	///	Returns the entity's position.
	const TwoFloats& getPosition() const {return (const TwoFloats&)position;};
	///	Returns the entity's radius.
	float getRadius() const {return 14.0f;};
	///	Returns the entity's colour.
	const ThreeFloats& getColour() const {return colour;};
	///	Returns true if other entities can pass through this one.
	bool getIncorporeal() const {return true;};
  private:
	///	The Pickup's position.
	TwoFloats position;
	///	Which type of pickup this is.
	std::wstring pickupType;

	///	True if the pickup can be collected by a bullet.
	bool bulletCollection;

	///	True if someone's collected this pickup.
	bool collected;
	///	The colour to display this pickup's announcement with.
	ThreeFloats collectorColour;

	///	True if we should be drawing the pickups as presents.
	bool december;

	///	The pickup's colour (for getColour()).
	ThreeFloats colour;
};

#endif
