blocklist.h

来自「用VC++DirectX技术的俄罗斯方块游戏」· C头文件 代码 · 共 46 行

H
46
字号
// BlockList.h: interface for the CBlockList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__INCLUDED_)
#define AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__INCLUDED_

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

////////////////////////////
// Block definitation
////////////////////////////
struct SBlock {
	short nX,nY,nColor;
};

///////////////////////////////////////////////////////////////////////
// CBlockList will be the parent class for the CShape class and the 
// CFlooredBlocks class. It contains the methods to maintain the lists.
///////////////////////////////////////////////////////////////////////

class CBlockList  
{
public:
	struct SNODE {
		SBlock Block;
		SNODE* pNext;
		inline SNODE();
	} *m_pListHead;

public:
	void Destroy(); // Empties the linked list.
	bool IsOccupied(short nX, short nY); // Returns true if the given location is already occupied
	void Display(short nX=0, short nY=0); // Displays the block on the screen offsetting it by nX and nY.
	bool Add(const SBlock Block);  // Adds the block to the end of the list.
	void dbgDisplay(); // Dumps the list to the debugger.
	bool Insert(const SBlock Block); //Inserts the block based on the value in linked list.
	CBlockList();
	virtual ~CBlockList();

};

#endif // !defined(AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__INCLUDED_)

⌨️ 快捷键说明

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