diff options
author | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:33:18 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:33:18 +0200 |
commit | 54b81b2dccd7cfa58e5bd5fe95a158126115381c (patch) | |
tree | 54496832d24749b710880bb342e514739b841155 /src/com/encrox/cplot/constants |
Diffstat (limited to 'src/com/encrox/cplot/constants')
-rwxr-xr-x | src/com/encrox/cplot/constants/Direction.java | 30 |
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;
+ }
+
+}
|