-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclass_node.h
More file actions
61 lines (43 loc) · 1.32 KB
/
Copy pathclass_node.h
File metadata and controls
61 lines (43 loc) · 1.32 KB
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
#ifndef pfNode_h
#define pfNode_h
#include <string>
class pfNode {
protected:
// type of node. 1 wall, 2 grass, 3 forest, 4 start-node, 5 target-node, 6 path
int type ;
// weight depends on the type. grass 1, forest 5, wall -1, rest 1
int weight;
bool isPath = false;
bool isVisited = false;
double f=-1;
int direction = 0; // 1 right, 2 up, 3 left, 4 down .
public:
// Constructor:
// Should be used for initializing pfNode
pfNode(int t);
//can be used, for createing *pfNode
pfNode()=default;
// Getter:
// Should be const, expecially for using a std::priority_queue
int GetType() const { return type; }
int GetWeight() const { return weight; }
std::string GetTypeName() const; // returns "Wall", "Grass", etc..
// Setter:
// set the node as a start or end point of the path.
void SetStart();
void SetTarget();
void SetPath();
void SetIsPath(); // ToDo: mit SetPath vereinheitlichen
void SetIsVisited();
void ResetIsPath(); // TODO: nach vereinheitlichung obselet.
void ResetIsVisited();
void Setf(double _f);
void setDirection(int dir);
// prints the node to std::cout with an rgb colored whitespace
void Print();
// additional types to visualize visited/checked nodes (Felix) :
void setType(int type);
void getType(int type);
// end of additions (Felix)
};
#endif