-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirection.java
More file actions
37 lines (34 loc) · 816 Bytes
/
Direction.java
File metadata and controls
37 lines (34 loc) · 816 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
/**
* An enumerator defining the 4 possible movement directions in a
* 2048 game.
*
* @author Charles Tianchen Yu
*
* DO NOT MODIFY THIS FILE
*/
public enum Direction
{
DOWN (0),
LEFT (1),
UP (2),
RIGHT (3);
private int rotationCount;
/**
* Constructor for the enum
*
* @param rotationCount see getRotationCount()
*/
Direction (int rotationCount) {
this.rotationCount = rotationCount;
}
/**
* Returns rotationCount, the number of counterclockwise rotations
* needed to rotate the game state before moving down (e.g. to
* move left, rotate once then move down).
*
* @return counterclockwise rotation count
*/
public int getRotationCount () {
return this.rotationCount;
}
}