//	TitleScreen.h - The title screen state.
//  ----------------------------------------------------------------------------
//	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 TITLESCREEN_H_
#define TITLESCREEN_H_

#include "GameState.h"
#include "TwoFloats.h"
#include "GameCore.h"

#include <vector>

class TonesGlobalData;
class TonesSounder;
class Crash;
class Dot;

///	The title screen state.
class TitleScreen : public GameState
{
  public:
	///	Constructor.
	TitleScreen(Application& app, SounderPtr& sound);
	///	Destructor.
	~TitleScreen();

	///	Updates the state.
	void update();
	///	Draws the state.
	void draw(DrawerPtr& d, float timestepInterp);

	///	Called when a key down event is received.
	void keyDown(const std::wstring& action,
				 const std::wstring& keyPressed,
				 int keyModifier);

	///	Called when a mouse down event is received.
	void mouseDown(int button, const TwoFloats& pos);
	///	Called when a mouse move event is received.
	void mouseMove(const TwoFloats& pos);

	///	Returns the name of this state.
	const std::wstring getName() const {return L"TitleScreen";};
	///	Used to construct instances of this state.
	static GameStateCreator<TitleScreen> creator;
  private:
	///	Handles all the game logic.
	GameCore gameCore;

	///	The mouse's current position.
	TwoFloats mousePos;

	///	If the mouse is currently over the survival button.
	bool mouseOverSurvival;
	///	If the mouse is currently over the free play button.
	bool mouseOverFreePlay;
	///	If the mouse is currently over the free play button.
	bool mouseOverTimeAttack;
	///	If the mouse is currently over the exit button.
	bool mouseOverExit;

	///	If the mouse is currently over the pure button.
	bool mouseOverPure;
	///	If the mouse is currently over the zen button.
	bool mouseOverZen;
	///	If the mouse is currently over the low button.
	bool mouseOverLow;

	///	The game's sounder.
	shared_ptr<TonesSounder> sounder;
	///	The game's global data.
	shared_ptr<TonesGlobalData> globalData;
};

#endif
