From 6a44b074f0169a1b0f9e92347af929c5e471746e Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 18 Apr 2015 13:44:44 +0200 Subject: Reorganised projects --- Week6 Sliding game solver/src/Direction.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Week6 Sliding game solver/src/Direction.java (limited to 'Week6 Sliding game solver/src/Direction.java') diff --git a/Week6 Sliding game solver/src/Direction.java b/Week6 Sliding game solver/src/Direction.java new file mode 100644 index 0000000..d4837b9 --- /dev/null +++ b/Week6 Sliding game solver/src/Direction.java @@ -0,0 +1,26 @@ +/** + * @author Sjaak Smetsers + * @version 1.2 + * @date 28-02-2015 + * An enumeration type for the 4 points of the compass + * Each constant has 2 (final) int attributes indicating + * the displacement of each direction on a 2-dimensional grid + * of which the origin is located in the upper left corner + */ +public enum Direction { + NORTH (0,-1), EAST (1,0), SOUTH(0,1), WEST(-1,0); + + private final int dx, dy; + private Direction (int dx, int dy) { + this.dx = dx; + this.dy = dy; + } + + public int GetDX () { + return dx; + } + + public int GetDY () { + return dy; + } +} -- cgit v1.2.3