-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCell.java
More file actions
48 lines (37 loc) · 975 Bytes
/
Copy pathCell.java
File metadata and controls
48 lines (37 loc) · 975 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.awt.*;
public class Cell {
private int x, y;
private Color color = Color.black;
private Boolean hasDiamond = false;
private Color diamondColor;
public Cell(int x, int y){
this.x = x;
this.y = y;
}
public void draw(Graphics g){
g.setColor(this.color);
g.fillRect(x, y, 35, 35);
g.setColor(Color.WHITE);
g.drawRect(x, y, 35, 35);
}
public int getX() {return x;}
public int getY() {return y;}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
public void setHasDiamond(Boolean hasDiamond) {
this.hasDiamond = hasDiamond;
}
public Boolean getHasDiamond() {
return hasDiamond;
}
public Color getDiamondColor() {
return diamondColor;
}
public void setDiamondColor(Color diamondColor) {
this.diamondColor = diamondColor;
}
}