From 54b81b2dccd7cfa58e5bd5fe95a158126115381c Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 25 Apr 2022 18:33:18 +0200 Subject: Initial commit --- src/com/encrox/cplot/constants/Direction.java | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/com/encrox/cplot/constants/Direction.java (limited to 'src/com/encrox/cplot/constants/Direction.java') 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; + } + +} -- cgit v1.2.1