#include
#include
#include<Windows.h>
#include<conio.h>
using namespace std;
class Point // Gride
{
private:
int row; // x;
int col; // y;
public:
Point(int r = 0, int c = 0) :row®, col© {}
~Point() = default;
Point(const Point&) = default;
Point& operator=(const Point&) = default;
int& Row() { return row; }
const int& Row() const { return row; }
int& Col() { return col; }
const int& Col() const { return col; }
};
class Brich // M
{
public:
static const int BrichTypeNum = 7;
static const int ColorNum = 7;
static const int GrideNum = 4;
static const int RotateNum = 4;
public:
enum ColorType
{
EMPTY = 0, RED = 1, YELLOW = 2, BLUS = 3,
//’ ’ ‘A’ ‘B’ ‘C’
GREEN = 4, PURPLE = 5, ORANGE = 6, GRAY = 7, BLACK = 8
// ‘D’ ‘E’ ‘F’ ‘G’ ‘#’
};
enum RotateState
{
INITIAL = 0, RR_ONE = 1, RR_TWO = 2, RR_THREE = 3
};
protected:
vector gride; // Brich
ColorType color;
RotateState state;
public:
Brich(const ColorType& c) : color©, state(RotateState::INITIAL)
{
gride.resize(4);
}
Brich(const Brich&) = default;
Brich& operator=(const Brich&) = default; // delete
virtual ~Brich() = default;
vector<Point>& Gride() { return gride; }
const vector<Point>& Gride()const { return gride; }
ColorType& Color() { return color; }
const ColorType& Color() const { return color; }
RotateState& State() { return state; }
const RotateState& Stat