//	ReverseTone.h - The reverse tone type.
//  ----------------------------------------------------------------------------
//	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 REVERSETONE_H_
#define REVERSETONE_H_

#include "../ToneCreator.h"
#include "DebugHeaders.h"

//------------------------------------------------------------------------------
///	The reverse tone type.
class ReverseTone : public Tone
{
  public:
	///	Constructor.
	ReverseTone(int startRail, int startNumRails, TonesSounderPtr& sound);
	///	Destructor.
	~ReverseTone();

	///	Returns the name of this tone type.
	std::wstring getName() const {return L"ReverseTone";};
	///	Returns the score you get if this tone makes it to the opposite side of the screen.
	int getScore() const {return 30;};
};

//------------------------------------------------------------------------------
///	The reverse tone type ToneCreator.
class ReverseCreator : public ToneCreator
{
  public:
	///	Constructor.
	ReverseCreator() {};
	///	Destructor.
	~ReverseCreator() {};

	///	Constructs this Creator's Tone, returns its pointer.
	TonePtr createTone(int startRail,
					   int startNumRails,
					   TonesSounderPtr& sounder) const
	{
		return TonePtr(NiallNew ReverseTone(startRail,
											startNumRails,
											sounder));
	};

	///	Returns which side of the screen this Tone should start from.
	bool getStartingSide() const {return false;};
	///	Used to make sure the player isn't put in an unfair position.
	int getMinDistanceToOtherTones() const {return 800;};
	///	Used to make sure the player isn't put in an unfair position.
	int getMaxNumOtherTones(const std::wstring& toneType) const
	{
		int retval = -1;

		if(toneType == L"FastTone")
			retval = 2;
		else if(toneType == L"MedTone")
			retval = 4;
		else if(toneType == L"SlowTone")
			retval = 16;

		return retval;
	};
	///	Used to make sure the player isn't put in an unfair position.
	int getMaxNumWarnings() const {return 2;};
};

#endif
