// ==============================================================
//	This file is part of Glest (www.glest.org)
//
//	Copyright (C) 2001-2008 Martiño Figueroa
//
//	You can redistribute this code and/or modify it under 
//	the terms of the GNU General Public License as published 
//	by the Free Software Foundation; either version 2 of the 
//	License, or (at your option) any later version
// ==============================================================

#ifndef _GLEST_GAME_BATTLEEND_H_
#define _GLEST_GAME_BATTLEEND_H_

#include "program.h"
#include "stats.h"
#include "leak_dumper.h"

namespace Glest{ namespace Game{

// =====================================================
// 	class BattleEnd  
//
///	ProgramState representing the end of the game
// =====================================================

class BattleEnd: public ProgramState{
private:
	Stats stats;

	GraphicButton buttonExit;
	int mouseX;
	int mouseY;
	int mouse2d;
	GraphicMessageBox mainMessageBox;
	Texture2D *renderToTexture;
	ProgramState *originState;
	const char *containerName;

	void showMessageBox(const string &text, const string &header, bool toggle);

public:
	BattleEnd(Program *program, const Stats *stats, ProgramState *originState);
	~BattleEnd();

	virtual void update();
	virtual void render();
	virtual void keyDown(SDL_KeyboardEvent key);
	virtual void mouseDownLeft(int x, int y);
	virtual void mouseMove(int x, int y, const MouseState *ms);
	//virtual void tick();
	virtual void reloadUI();
};

}}//end namespace

#endif
