summaryrefslogtreecommitdiff
path: root/src/com/encrox/cplot/constants/Direction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/encrox/cplot/constants/Direction.java')
-rwxr-xr-xsrc/com/encrox/cplot/constants/Direction.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/com/encrox/cplot/constants/Direction.java b/src/com/encrox/cplot/constants/Direction.java
new file mode 100755
index 0000000..11b1932
--- /dev/null
+++ b/src/com/encrox/cplot/constants/Direction.java
@@ -0,0 +1,30 @@
+package com.encrox.cplot.constants;
+
+public class Direction {
+
+ public static final byte NORTH = 0;
+ public static final byte SOUTH = 1;
+ public static final byte EAST = 2;
+ public static final byte WEST = 3;
+ public static final byte UP = 4;
+ public static final byte DOWN = 5;
+
+ public static byte getDirection(String label) {
+ switch(label.toLowerCase()) {
+ case "north":
+ return NORTH;
+ case "south":
+ return SOUTH;
+ case "east":
+ return EAST;
+ case "west":
+ return WEST;
+ case "up":
+ return UP;
+ case "down":
+ return DOWN;
+ }
+ return -1;
+ }
+
+}