-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid.h
59 lines (42 loc) · 1.2 KB
/
grid.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
52
53
54
55
56
57
58
59
#ifndef GRID_H
#define GRID_H
#include <vector>
#include <set>
#include <string>
#include <iostream>
#include <memory>
#include "object.h"
#include "util.h"
using std::vector;
using std::string;
using std::set;
class Grid {
public:
int n;
int m;
vector<vector<std::shared_ptr<Object>>> board;
set<pair<int, int>> starts;
set<pair<int, int>> ends;
set<pair<int, int>> dots;
set<pair<int, int>> triangles;
set<pair<int, int>> blobs;
set<pair<int, int>> stars;
set<pair<int, int>> blocks;
set<pair<int, int>> cancels;
set<pair<int, int>> ignored; // ignored cancel operations
pair<int, int> begin;
Grid();
Grid(vector<vector<std::shared_ptr<Object>>>& v);
void defaultGrid();
void drawLine(pair<int, int> a, pair<int, int> b);
void drawPath(vector<pair<int, int>> v);
virtual ~Grid();
string to_string();
void disp();
// The verification algorithm
bool inside(pair<int, int> p);
bool ver(int sx, int sy);
bool check();
bool validateRegion(int sx, int sy, vector<pair<int, int>> ban);
};
#endif