📄 game_statehandler.h
字号:
// Class automatically generated by Dev-C++ New Class wizard
#ifndef GAME_STATEHANDLER_H
#define GAME_STATEHANDLER_H
#include <irrlicht.h>
//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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -