-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotInfo.java
executable file
·93 lines (81 loc) · 1.75 KB
/
DotInfo.java
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import java.lang.Exception ;
import java.io.Serializable ;
/**
* The class <b>DotInfo</b> is a simple helper class to store the initial color and state
* (captured or not) at the dot position (x,y)
*
* @author Guy-Vincent Jourdan, University of Ottawa
*/
public class DotInfo implements Cloneable, Serializable {
/**
* The coordinate of this DotInfo.
*/
private int x;
private int y;
/**
* The initial color at (x,y)
*/
private int color;
/**
* Is that locatio captured ?
*/
private boolean captured;
/**
* Constructor
*
* @param x
* the x coordinate
* @param y
* the y coordinate
* @param color
* the initial color
*/
public DotInfo(int x, int y, int color){
this.x = x;
this.y = y;
this.color = color;
}
/**
* Getter method for the attribute x.
*
* @return the value of the attribute x
*/
public int getX(){
return x;
}
/**
* Getter method for the attribute y.
*
* @return the value of the attribute y
*/
public int getY(){
return y;
}
/**
* Setter for captured
* @param captured
* the new value for captured
*/
public void setCaptured(boolean captured) {
this.captured = captured;
}
/**
* Get for captured
*
* @return captured
*/
public boolean isCaptured() {
return captured;
}
/**
* Get for color
*
* @return color
*/
public int getColor() {
return color ;
}
protected DotInfo clone() throws CloneNotSupportedException {
return (DotInfo) super.clone() ;
}
}