This repository was archived by the owner on Feb 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCell.cpp
More file actions
67 lines (64 loc) · 1.37 KB
/
Cell.cpp
File metadata and controls
67 lines (64 loc) · 1.37 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
62
63
64
65
66
67
#include "Cell.h"
#include "myconio.h"
#include <cstring>
#include <cstdio>
Cell::Cell(int number, bool mine) : number(number), mine(mine){
this->visit = false;
this->flag = false;
this->currentSign = 219;
this->lastSign = currentSign;
this->color = GREEN;
this->bgC = GREEN;
}
void Cell::setNumber(int number){
this->number = number;
}
void Cell::setCurrentSign(char currentSign){
this->lastSign = this->currentSign;
this->currentSign = currentSign;
}
void Cell::setLastSign(char lastSign){
this->lastSign = lastSign;
}
void Cell::setMine(bool mine){
this->mine = mine;
}
void Cell::setVisit(bool visit){
this->visit = visit;
}
void Cell::setFlag(bool flag){
this->flag = flag;
}
void Cell::setColor(int color){
this->color = color;
}
void Cell::setBgC(int bgC){
this->bgC = bgC;
}
int Cell::getNumber() const{
return this->number;
}
char Cell::getCurrentSign() const{
return this->currentSign;
}
char Cell::getLastSign() const{
return this->lastSign;
}
bool Cell::isMine() const{
return this->mine;
}
bool Cell::isVisit() const{
return this->visit;
}
bool Cell::isFlag() const{
return this->flag;
}
int Cell::getColor() const{
return this->color;
}
int Cell::getBgC() const{
return this->bgC;
}
bool Cell::canOpen() const{
return (this->number >= 0 && !this->flag && !this->mine && !this->visit);
}