-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.cpp
More file actions
34 lines (33 loc) · 697 Bytes
/
Copy pathnode.cpp
File metadata and controls
34 lines (33 loc) · 697 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
#include <iostream>
#include "node.h"
using namespace std;
Node::Node(){ //initialize the node with cover=0 and state=0
this->cover=0;
this->state=0;
}
Node::~Node(){}
bool Node::isCover(){ //return cover==0
return this->cover==0;
}
void Node::aroundMinesIncrease(){
this->state++;
} //state++
void Node::setMine(){ //state=-1
this->state=-1;
}
bool Node::isMine(){ //return state==-1
return this->state==-1;
}
bool Node::isSet(){ //return state==0
return this->state==0;
}
void Node::reset(){ // cover=0 and state=0
this->cover=0;
this->state=0;
}
int Node::getState(){
return this->state;
}
void Node::setUncover(){
this->cover=1;
}