?? m_queue.cpp
字號(hào):
#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;
//}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -