-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.h
68 lines (51 loc) · 1.25 KB
/
node.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
60
61
62
63
64
65
66
67
68
#pragma once
#include <string>
#include <vector>
#include "model.h"
#include <map>
class point {
public:
int x;
int y;
point(const int &x, const int &y) {
this->x = x;
this->y = y;
}
point() {
this->x = -1;
this->y = -1;
}
bool operator<(const point &rhs) const {
return this->x < rhs.x && this->y < rhs.y;
}
bool operator==(const point &rhs) const {
return this->x == rhs.x && this->y == rhs.y;
}
friend std::ostream &operator<<(std::ostream &os, const point &point);
};
class node {
public:
double cost;
std::vector<model> map;
std::vector<point> pos;
point target;
point door;
model belowBlock1;
model belowBlock2;
std::vector<std::vector<point>> parents = {};
std::vector<std::vector<point>> parents_print = {};
std::vector<std::string> steps = {};
int cols;
int rows;
std::map<int, point> teletransport_tiles = {};
bool closedTiles;
node(const std::vector<int> &initializer, const int &rows, const int &cols);
~node();
node();
bool operator<(const node &rhs) const;
bool objective() const;
void print() const;
friend std::ostream &operator<<(std::ostream &os, const node &node);
void node::printPoint();
};
int get_index(const int &x, const int &y, const int &cols);