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

📄 cblock.h

📁 俄罗斯方块3D 程序+源码俄罗斯方块3D(程序+源码
💻 H
字号:
#ifndef CBlock_h
#define CBlock_h

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

#include "struct.h"

//////////////////////////////////////////////////////////////////////
//方块类,描述单个方块的位置,颜色
//////////////////////////////////////////////////////////////////////
class CBlock  
{
public:
	CBlock();
	CBlock( const CBlock &block );
	CBlock( int row, int col, int iMat );
	~CBlock();
	CBlock &operator = ( const CBlock &block );

	int GetRow() const { return m_Position.row; }
	int GetCol() const { return m_Position.col; }
	
	void SetRow( int i ) { m_Position.row = i; }
	void SetCol( int i ) { m_Position.col = i; }

	void SetMaterialIndex( int i )
	{ m_iMaterialIndex = i; }

	const POSITION &GetPosition() const 
	{ return m_Position; }
	int GetMaterialIndex() const
	{ return m_iMaterialIndex; }

	friend void BlockRotation( CBlock &newBlock, const POSITION &pos, const CBlock &oldBlock );
	friend void BlockDrop( CBlock &newBlock, const CBlock &oldBlock );
	friend void BlockMovement( CBlock &newBlock, const CBlock &oldBlock, int iStep );

private:
	POSITION	m_Position;				//位置
	int			m_iMaterialIndex;		//颜色


};



#endif 

⌨️ 快捷键说明

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