📄 cgamestate.h
字号:
#ifndef CGameState_h
#define CGameState_h
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//游戏的各种状态
enum GAMESTATE
{
READY_DROP = 0, //装备下落
BLOCK_DROP = 1, //方块下落中
CHECK_FULL_LINE = 2, //处理满行
ADJUST_POOL = 3, //调整方块池
GAME_PAUSE = 4, //游戏暂停
GAME_OVER = 5, //游戏结束
};
//////////////////////////////////////////////////////////////////////////
//游戏状态管理类,记录各游戏中的状态
//////////////////////////////////////////////////////////////////////////
class CGameState
{
public:
CGameState();
~CGameState();
bool Init();
void Free();
void SetGameState( GAMESTATE gs );
GAMESTATE &GetGameState() { return m_GameState; }
int GetHalfRow() { return m_iHalfRow; }
int GetHalfCol() { return m_iHalfCol; }
int GetScore() { return m_iScore; }
void AddScore( int i );
void PauseGame();
private:
GAMESTATE m_GameState;
GAMESTATE m_LastState;
int m_iHalfRow; //方块池总行数一半
int m_iHalfCol; //方块池总列数一半
int m_iScore; //游戏得分
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -