?? matrix.h
字號:
// Matrix.h: interface for the Matrix class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MATRIX_H__05EC1871_E972_11D5_9B6C_AD7148B27E00__INCLUDED_)
#define AFX_MATRIX_H__05EC1871_E972_11D5_9B6C_AD7148B27E00__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
# include "Diamond.h"
class Matrix
{
public:
int cols; //列
int rows; //行
int* gridData;
COLORREF matrixColor; //窗口顏色
CDC* pDC;
int winX,winY; //窗口起點坐標
int winWidth, winHeight; //窗口寬度與高度
int cellWidth, cellHeight; //單原格寬度與高度
int newScore; //計錄現在成績
int oldScore; //保存上次成績
bool hasGrid; //計錄是否畫網格
void Draw(CDC *pDC,int x,int y,int cx,int cy,COLORREF diamonColor, bool update, bool hasGrid);
void DrawDiamon(CDC *pDC,int x,int y,Diamond const &m,COLORREF diamonColor); //畫方塊
void SetMatrix(int x,int y,int cx,int cy,COLORREF diamonColor); //設置Matrix對象的數據
bool CanTrun (Diamond const& m, int col, int row) const; //判斷能否翻轉
bool CanDown (Diamond const& m, int col, int row) const; //判斷能否向下
bool CanRight (Diamond const&m, int col, int row) const; //判斷能否右
bool CanLeft (Diamond const&m, int col, int row) const; //判斷能否左
Matrix& Add (Diamond const& m, int x, int y); //方塊數據累加
bool IsFullLine(int line) const; //判斷指定行是否滿
void DeleteLine(int line) const; //刪除指定行
bool Tidy (); //整理
void Init ();//初始化數據
Matrix(int rows ,int cols);
~Matrix();
};
#endif // !defined(AFX_MATRIX_H__05EC1871_E972_11D5_9B6C_AD7148B27E00__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -