📄 gamefield.h
字号:
#pragma once
#include "afx.h"
#include <gdiplus.h>
#include "Square.h"
#define HEIGHT 30
#define WIDTH 16
#define SIZE 10
using namespace Gdiplus;
class GameField :
public CObject
{
public:
GameField(HDC & Hdc,DOCINFO & docinfo);
static int Width ;/* = 16;*/
static int Height ;/*= 30;*/
Color BackColor;
static int SquareSize ; /* = 10;*/
static HDC* hdc;
static DOCINFO * info;
static int bitEmpty;//= 0x0;
static int bitFull;//=0xffff
static bool IsEmpty(int const& x,int const& y);
static int CheckLines();
static void StopSquare(Square const& square,int const& x,int const& y);
static void Redraw();
static void Reset();
static void ReDrawAll();
static void Clear();
private:
static Square arrGameField[WIDTH][HEIGHT];
static int arrBitGameField[HEIGHT];
public:
~GameField(void);
};
enum BlockTypes
{
Undefined =0,
Square_ =1,
Line = 2,
J = 3,
L = 4,
T = 5,
Z = 6,
S = 7
};
enum RotationDirecttions
{
NORTH = 1,
EAST = 2,
SOUTH = 3,
WEST =4
};
int Random(int const& start,int const& end);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -