-
Notifications
You must be signed in to change notification settings - Fork 0
/
Block.java
92 lines (71 loc) · 1.6 KB
/
Block.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
public class Block {
private boolean isOccupied;
private boolean isFinishBlock;
private int x;
private int y;
private int endX;
private int endY;
private String blockImageLocation;
private boolean isBlink;
public Block(int x, int y) {
this.isOccupied = false;
this.isFinishBlock = false;
this.x = x;
this.y = y;
this.isBlink = false;
}
public Block(boolean isOccupied, boolean isFinishBlock, int x, int y, boolean isBlink) {
this.isOccupied = isOccupied;
this.isFinishBlock = isFinishBlock;
this.x = x;
this.y = y;
this.isBlink = isBlink;
}
public void updateBlockInfo() {
isOccupied = !isOccupied;
}
public boolean isOccupied() { //previously getBlockInfo()
return isOccupied;
}
public void setOccupied(boolean isOccupied) {
this.isOccupied = isOccupied;
}
public boolean isFinishBlock() { //previously isFinished()
return isFinishBlock;
}
public void setFinishBlock(boolean isFinishBlock) {
this.isFinishBlock = isFinishBlock;
}
public int getX() {
return x;
}
public int getHorizontalX() {
return endX;
}
public void setX(int x) {
this.x = x;
}
public void setHorizontalX(int x, int endX) {
this.x = x;
this.endX = endX;
}
public int getY() {
return y;
}
public int getVerticalY() {
return endY;
}
public void setY(int y) {
this.y = y;
}
public void setVerticalY(int y, int endY) {
this.y = y;
this.endY = endY;
}
public boolean isBlink() {
return isBlink;
}
public void setBlink(boolean isBlink) {
this.isBlink = isBlink;
}
}