www.pudn.com > ICE_1.4.zip > game_statehandler.h


// Class automatically generated by Dev-C++ New Class wizard 
 
#ifndef GAME_STATEHANDLER_H 
#define GAME_STATEHANDLER_H 
 
#include  
//using namespace irr; 
 
#include "../game_states.h" 
 
class game_State; 
 
//typedef enum tGAME_STATE; 
 
// BASE CLASS  
// provides game_tetris with neccesary functionality to handle game_State derivatives 
class game_StateHandler 
{ 
	public: 
		// class constructor 
		game_StateHandler(); 
		// class destructor 
		~game_StateHandler(); 
		 
protected: 
    tGAME_STATE m_GameState;  //enum of the current state 
    game_State *m_pCurrState; //pointer to the current state 
    bool destroyMe;           //set by requestDestroy, will call Destroy() if true 
 
    irr::IrrlichtDevice       *m_device;    //irrlicht device pointer 
    irr::video::IVideoDriver  *m_driver;    //irrlicht video driver pointer 
    irr::scene::ISceneManager *m_smgr;      //irrlicht scene manager ptr 
		 
public:		 
    irr::IrrlichtDevice       *getDevice() {return m_device; }  
    irr::video::IVideoDriver  *getDriver() {return m_driver; } 	 
    irr::scene::ISceneManager *getSceneMgr() { return m_smgr; } 
     
    //passively tell game to quit (will be handled next loop) 
    void RequestDestroy() { destroyMe = true; } 
    //ask the handler to transition to a different state 
    //(the hanlder can decide not to, or call other functions first) 
    virtual void RequestStateChange(tGAME_STATE newState) = 0; 
}; 
 
#endif // GAME_STATEHANDLER_H