package j2048;

/**
 * The various directions on a board. This enum can be used for multiple
 * purposes: for example, it can indicate the direction of a move, or the
 * direction of adjacent tiles.
 * 
 * @author William Chargin
 * 
 */
public enum Direction {

	/**
	 * The north (negative-y) direction.
	 */
	NORTH,

	/**
	 * The east (positive-x) direction.
	 */
	EAST,

	/**
	 * The south (positive-y) direction.
	 */
	SOUTH,

	/**
	 * The west (negative-x) direction.
	 */
	WEST;

}

@@ -192,16 +192,342 @@
  tiles.%0A
+ * %3Cp%3E%0A * Each %7B@code Direction%7D is equipped with %7B@code x%7D- and %7B@code y%7D-multipliers.%0A * These indicate the numerical orientation of the direction. For example, the%0A * %7B@link #WEST%7D direction points in the negative %7B@code x%7D direction, so its%0A * %7B@code x%7D-multiplier is %7B@code -1%7D and its %7B@code y%7D-multiplier is %7B@code 0%7D.%0A
  * %0A * @
@@ -607,25 +607,33 @@
 h (negative-
-y
+%7B@code y%7D
 ) direction.
@@ -644,16 +644,23 @@
 /%0A%09NORTH
+(0, -1)
 ,%0A%0A%09/**%0A
@@ -678,25 +678,33 @@
 t (positive-
-x
+%7B@code x%7D
 ) direction.
@@ -714,16 +714,22 @@
 */%0A%09EAST
+(1, 0)
 ,%0A%0A%09/**%0A
@@ -752,17 +752,25 @@
 ositive-
-y
+%7B@code y%7D
 ) direct
@@ -785,16 +785,22 @@
 /%0A%09SOUTH
+(0, 1)
 ,%0A%0A%09/**%0A
@@ -822,17 +822,25 @@
 egative-
-x
+%7B@code x%7D
 ) direct
@@ -854,13 +854,750 @@
 */%0A%09WEST
-;
+(-1, 0);%0A%0A%09/**%0A%09 * The %7B@code x%7D-multiplier for this direction.%0A%09 */%0A%09private final int x;%0A%0A%09/**%0A%09 * The %7B@code y%7D-multiplier for this direction.%0A%09 */%0A%09private final int y;%0A%0A%09/**%0A%09 * Creates the %7B@code Direction%7D with the given %7B@code x%7D- and %7B@code y%7D%0A%09 * -multipliers.%0A%09 * %0A%09 * @param x%0A%09 *            the %7B@code x%7D-multiplier%0A%09 * @param y%0A%09 *            the %7B@code y%7D-multiplier%0A%09 */%0A%09private Direction(int x, int y) %7B%0A%09%09this.x = x;%0A%09%09this.y = y;%0A%09%7D%0A%0A%09/**%0A%09 * Gets the %7B@code x%7D-multiplier for this direction.%0A%09 * %0A%09 * @return the %7B@code x%7D-multiplier%0A%09 */%0A%09public int getX() %7B%0A%09%09return x;%0A%09%7D%0A%0A%09/**%0A%09 * Gets the %7B@code y%7D-multiplier for this direction.%0A%09 * %0A%09 * @return the %7B@code y%7D-multiplier%0A%09 */%0A%09public int getY() %7B%0A%09%09return y;%0A%09%7D
 %0A%0A%7D%0A

Add Direction multipliers for numeric usage