enum Status CLOSED OPEN FULL Cell of grid public class Cell private st

 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
enum Status
{
CLOSED, OPEN, FULL
}
/**
* Cell of a grid
*/
public class Cell
{
private static int _id = 0;
private int id = _id++;
private Status status = Status.CLOSED;
public static void resetId()
{
_id = 0;
}
public int getId()
{
return id;
}
public Status getStatus()
{
return status;
}
public void setStatus(Status status)
{
this.status = status;
}
@Override
public String toString()
{
return "Cell{" +
"status=" + status +
", id=" + id +
'}';
}
}