⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blocklist.h

📁 一个完整的俄罗斯方块游戏
💻 H
字号:
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -