/*game.h: Class that implements the management of game states. Based upon H.S. Fortuna's game framework with some minor alterations as noted

   Copyright (C) 2008  Stuart William Coulson

   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 _GAME_H__
#define _GAME_H__

#include "texture.h"
#include "font.h"
#include "3DModel.h"
#include "primitives.h"

enum GAMESTATE {SPLASH, MENU, LEVEL1, WIN, LOSE, QUIT};		//Added WIN, LOSE and QUIT  states so a variety of endings are possible

class CGame
{	
public:
	CGame(void);
	~CGame(void);

	bool Start(void);
	void GameLoop(void);
	void GameSplash(void);
	void GameMenu(void);
	void GameLevel1(void);
	void GameWin(void);			//Added three class functions that are called when a particular ending state occurs (death, win, quit)
	void GameLose(void);
	void GameQuit(void);
	void Stop(void);
	
	static void SignalHandler(int Signal);
	
	inline bool GetRunningStatus(void)
		{return m_bRunning;}
		
	static inline void SetRunningStatus(bool Status)
		{m_bRunning = Status;}
		
protected:
	int difficulty;			//Added a variable used to retain the current difficulty level (easy, medium, hard)
	CFont Font;
	CTexture FontTex;
	MilkshapeModel dwarf;			//Added a dwarf model object. The reason for this is that the dwarf model is used within multiple states of the game and rather than create multiple instances in each state, just have a single instance and use it again and again.
	
	GAMESTATE GameState;
	static bool m_bRunning;
};

#endif
