//	PickupFreeze.h - Freeze Pickup.
//  ----------------------------------------------------------------------------
//	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 PICKUPFREEZE_H_
#define PICKUPFREEZE_H_

#include "../Pickup.h"
#include "../OverrideBehaviour.h"

class OverrideFreeze;

//------------------------------------------------------------------------------
///	Freeze Pickup.
class PickupFreeze : public Pickup
{
  public:
	///	Constructor.
	PickupFreeze();
	///	Destructor.
	~PickupFreeze();

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

	///	So subclasses can load and return their icon.
	const std::wstring getIcon() const {return L"pickup-freeze";};
};

//------------------------------------------------------------------------------
///	Freeze behaviour.
class BehaviourFreeze : public OverrideBehaviour
{
  public:
	///	Constructor.
	BehaviourFreeze(const std::wstring& icon);
	///	Destructor.
	~BehaviourFreeze();

	///	Moves the associated Tone.
	/*!
		\return True if this behaviour should be deleted on return.
	 */
	bool moveTone(Tone& tone,
				  std::vector<TonePtr>& allTones,
				  float globalSpeed);
	///	Draws any extra information on top of the tone image.
	void drawExtraInformation(DrawerPtr& d,
							  float timestepInterp,
							  const Tone& tone);
  private:
	///	The id for the pickup's icon.
	std::wstring pickupIcon;

	///	Used to count down till the Tone becomes unfrozen.
	float counter;
};

#endif
