If you think the Android project blocks-game listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package cz.kotu.grids;
/*www.java2s.com*//**
* @author Kotuc
*/publicclass Dir {
publicstaticfinal Dir
E = new Dir(1, 0),
NE = new Dir(1, 1),
N = new Dir(0, 1),
NW = new Dir(-1, 1),
W = new Dir(-1, 0),
SW = new Dir(-1, -1),
S = new Dir(0, -1),
SE = new Dir(1, -1);
privatefinalint dx, dy;
publicint dx() {
return dx;
}
publicint dy() {
return dy;
}
private Dir(int dx, int dy) {
this.dx = dx;
this.dy = dy;
}
Dir[] values4() {
returnnew Dir[]{E, N, W, S};
}
Dir[] values8() {
returnnew Dir[]{E, NE, N, NW, W, SW, S, SE};
}
}