-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controller.h
51 lines (34 loc) · 1014 Bytes
/
Controller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef RUSSIASQUARE_CONTROLLER_H
#define RUSSIASQUARE_CONTROLLER_H
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <string>
#include <vector>
#include <time.h>
#include "CMyBlock.h"
#include "Visualizer.h"
#define MAP_HEIGHT 24
#define MAP_WIDTH 12
using namespace std;
using namespace cv;
class Controller {
public:
Controller(int stepTime);
void InitBlocks();
bool m_map[MAP_HEIGHT][MAP_WIDTH] = {0};
int m_curBlockId;
int m_nextBlockId;
Visualizer m_visualizer;
void run();
bool genBlock(int id);
bool checkBlock(const int& posX, const int& posY, const CMyBlock& block);
void copyBlockToMap(const int& posX, const int& posY, const CMyBlock& block);
void deleteBlockFromMap(const int& posX, const int& posY, const CMyBlock& block);
bool removeLines();
private:
int m_stepTime;
vector<CMyBlock> vecBlockList;
};
#endif //RUSSIASQUARE_CONTROLLER_H