📄 cblockfollowing.h
字号:
#ifndef CBlockFollowing_h
#define CBlockFollowing_h
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "CBlock.h"
#include "Struct.h"
#include "CDynamicArray.h"
class CGameRender;
/////////////////////////////////////////////////////////////
//描绘正在落下的方块:所含方块数,方块的状态,中心点
/////////////////////////////////////////////////////////////
class CBlockFollowing
{
public:
friend class CGameRender;
CBlockFollowing();
~CBlockFollowing();
bool Init();
void Free();
void AddBlocks( CBlock &block );
void OnCreateBlock();
void SetNumBlock( int i ) { m_iNumBlock = i; }
int GetNumBlock() { return m_iNumBlock; }
void SetPos( int row, int col )
{ m_Pos.row = row; m_Pos.col = col; }
public:
void Drop();
void Move( bool IsLeft );
void Rotate();
void Stop();
private:
void Transform();
bool IsMobile();
private:
int m_iNumBlock; //所包含的方块数
POSITION m_Pos; //中心点
CDynamicArray<CBlock> m_BlockArray1; //两个数组,一个用于记录各个方块的位置
CDynamicArray<CBlock> m_BlockArray2; //另一个用于记录新的位置
CBlock *m_BlockArray; //指向当前方块状态数组的指针
CBlock *m_NewPosition; //指向新方块状态数组的指针
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -