-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.cpp
More file actions
57 lines (48 loc) · 835 Bytes
/
Node.cpp
File metadata and controls
57 lines (48 loc) · 835 Bytes
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
#include <iostream>
#include "Node.h"
/**
* constructor for Node.
*/
Node::Node() {
Node::daddy = NULL;
Node::visited = false;
}
/**
* setting daddy of a node.
* @param dad
*/
void Node::setDaddy(Node* dad) {
Node::daddy = dad;
}
/**
* get the daddy of a node.
* @return Node*
*/
Node* Node::getDaddy() const {
return daddy;
}
/**
* return true if the node was already visited.
* @return bool
*/
bool Node::isVisited() const {
return visited;
}
/**
* setting true if the node has been visited.
* @param visited
*/
void Node::setVisited(bool visited) {
Node::visited = visited;
}
/**
* function to print nodes.
* @param output
*/
ostream &operator<<(ostream &output, const Node* n) {
n->printNode(output);
return output;
}
bool Node::isObstacle() const {
return obstacle;
}