-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCell.java
More file actions
50 lines (39 loc) · 1.08 KB
/
Copy pathCell.java
File metadata and controls
50 lines (39 loc) · 1.08 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
public class Cell {
private String character;
private boolean mineStatus;
private int row;
private int column;
// Constructor - defines what a Cell is
public Cell(String character, boolean mineStatus, int row, int column) {
this.character = character;
this.mineStatus = mineStatus;
this.row = row;
this.column = column;
}
// Getter method to retrieve the mine status of the cell
public boolean getMineStatus() {
return mineStatus;
}
// Getter method to retrieve the row of the cell
public int getMineRow() {
return row;
}
// Getter method to retrieve the column of the cell
public int getMineColumn() {
return column;
}
public String getMineCharacter() {
return character;
}
// Setter method to set the value of the cell (will be used when the user
public void setCharacter(String newCharacter) {
this.character = newCharacter;
}
public void setMineStatus(boolean mineStatus) {
this.mineStatus = mineStatus;
}
// This is important to print the value of the cell as a readable String, rather
public String toString() {
return this.character;
}
}