//	PickupDeflectDown.cpp - Deflect Down 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/>.
//	----------------------------------------------------------------------------

#include "PickupDeflectDown.h"
#include "drawing/Drawer.h"
#include "DebugHeaders.h"
#include "GameCounter.h"
#include "../Tone.h"

#include <sstream>

using namespace std;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
PickupDeflectDown::PickupDeflectDown():
Pickup(L"Deflect Down")
{

}

//------------------------------------------------------------------------------
PickupDeflectDown::~PickupDeflectDown()
{

}

//------------------------------------------------------------------------------
shared_ptr<OverrideBehaviour> PickupDeflectDown::getBehaviour() const
{
	return shared_ptr<OverrideBehaviour>(NiallNew BehaviourDeflectDown(L"pickup-deflectDown"));
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
BehaviourDeflectDown::BehaviourDeflectDown(const wstring& icon):
OverrideBehaviour(icon),
pickupIcon(icon)
{

}

//------------------------------------------------------------------------------
BehaviourDeflectDown::~BehaviourDeflectDown()
{

}

//------------------------------------------------------------------------------
bool BehaviourDeflectDown::moveTone(Tone& tone,
									std::vector<TonePtr>& allTones,
									float globalSpeed)
{
	tone.startSwipe(tone.getPosition());
	tone.endSwipe(tone.getPosition()+32.0f);

	return true;
}

//------------------------------------------------------------------------------
void BehaviourDeflectDown::drawExtraInformation(DrawerPtr& d,
												float timestepInterp,
												const Tone& tone)
{
	//Draw the icon.
	d->drawImage(pickupIcon, tone.position-64.0f);
}
