|
// 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_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.