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

📄 m_queue.cpp

📁 基于WindowCE上对于windows mobile开发的一个俄罗斯方块程序
💻 CPP
字号:
#include "StdAfx.h"
#include "m_Queue.h"
#define IDB_BITMAP_BLOCK                132

m_Queue::m_Queue(void)
{


}

m_Queue::~m_Queue(void)
{
}

void m_Queue::OnDraw(CDC * pDC,int Bottom_X,int Bottom_Y)
{
	for (int i = 0;i<QUEUELENTH;i++)
	{
		_Cell[i].OnDraw(pDC,Bottom_X,Bottom_Y);
	}

}

void m_Queue::SetPosition(int index, short sX, short sY)
{
	_Cell[index].SetPosition(sX,sY);
}


int m_Queue::GetColorIndex(int index)
{
	return _Cell[index]._ColorIndex;
}

void m_Queue::SetColorIndex(int index,int color)
{
	 _Cell[index]._ColorIndex= color;
}

void m_Queue::SetRandomColorIndex()
{
	int index = rand() % COLORKIND;
	double j = 0;
	
	for (int i = 1;i<QUEUELENTH;i++)
	{
		/*   Display   10   numbers.   */   
		int index2 = rand() % COLORKIND;
		j = j+index2;
		_Cell[i]._ColorIndex = index2;
	}
	if ((index*3) == j)
	{
		index = COLORKIND-1-index;
	}
	_Cell[0]._ColorIndex = index;
}

void m_Queue::TurnAround()
{
	int tmp = _Cell[0]._ColorIndex;
	
	_Cell[0]._ColorIndex = _Cell[1]._ColorIndex;
	_Cell[1]._ColorIndex = _Cell[3]._ColorIndex; 
	_Cell[3]._ColorIndex = _Cell[2]._ColorIndex; 
	_Cell[2]._ColorIndex = tmp; 
	
	
}



//m_Queue& m_Queue::operator = (const m_Queue &lhs)
//{
//	return *this;
//}

⌨️ 快捷键说明

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