flooredblocks.h

来自「一个完整的俄罗斯方块游戏」· C头文件 代码 · 共 38 行

H
38
字号
// FlooredBlocks.h: interface for the CFlooredBlocks class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_)
#define AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//////////////////////////////////////////////////////////////////////
// The CFlooredBlocks maintains the list of blocks that have been placed 
// on the floor. All the shapes that fall down are added to this list.
//////////////////////////////////////////////////////////////////////
class CFlooredBlocks: public CBlockList  
{
public:
	bool IsGameOver();

	void IncrementYabove(short nY); // Helper function for CheckAndRemoveContinuousBlocks 
	                                // used to drop the blocks above the removed line.
	bool IsOccupied(CBlockList& BlockList, short nX, short nY);
	bool Insert(CBlockList& BlockList);
	void Display();
	short CheckAndRemoveContinuousBlocks(); // Returns the number of lines removed. 
	                                        // This can be used to calculate the score. 
	                                        // This function also adjust the coordinates 
	                                        // of all the other blocks so that they fall.
	                                        
	bool IsOccupied(short X, short Y);
	CFlooredBlocks(RECT rcBoundary);
	virtual ~CFlooredBlocks();
	RECT m_rcBoundary;
};

#endif // !defined(AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?