//	Pickup.h - Base class for all Pickups.
//  ----------------------------------------------------------------------------
//	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 PICKUP_H_
#define PICKUP_H_

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

#include <stdint.h>

class Pickup;
class Drawer;
class OverrideBehaviour;
typedef shared_ptr<Pickup> PickupPtr;
typedef shared_ptr<Drawer> DrawerPtr;

///	Base class for all Pickups.
class Pickup
{
  public:
	///	Constructor.
	Pickup(const std::wstring& pickupName);
	///	Destructor.
	virtual ~Pickup();

	///	Draws the Pickup.
	void draw(DrawerPtr& d, float timestepInterp);

	///	Sets the Pickup's position.
	void setPosition(const TwoFloats& pos);
	///	Returns the Pickup's position.
	const TwoFloats& getPosition() const {return position;};

	///	Sets the Tone this Pickup is carried by.
	void setTone(TonePtr t);

	///	Constructs and returns this Pickup's OverrideBehaviour.
	virtual shared_ptr<OverrideBehaviour> getBehaviour() const = 0;

	///	Returns the name of the Pickup's icon.
	virtual const std::wstring getIcon() const = 0;
	///	Returns the name of this Pickup.
	virtual const std::wstring& getName() const {return name;};
  private:
	///	The Pickup's name.
	std::wstring name;

	///	The Pickup's position.
	TwoFloats position;

	///	The Tone the Pickup is being carried by.
	weak_ptr<Tone> tone;

	///	Used to draw the Pickup's name.
	TextLayout textLayout;
};

#endif
