From 76fcc2c497e61829c416e55bc9738f4cd71265c0 Mon Sep 17 00:00:00 2001 From: James Khan Date: Sat, 11 May 2019 20:18:56 +0100 Subject: [PATCH] Remove magic number translations and remove uppercase names. --- .../java/com/jme3/input/JoystickState.java | 39 +------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/input/JoystickState.java b/jme3-core/src/main/java/com/jme3/input/JoystickState.java index 8e78bd0ee..6e603ea83 100644 --- a/jme3-core/src/main/java/com/jme3/input/JoystickState.java +++ b/jme3-core/src/main/java/com/jme3/input/JoystickState.java @@ -6,42 +6,7 @@ package com.jme3.input; */ public enum JoystickState { - // a list of connected/disconnected codes from various contexts. - - // using the JoystickState.fromCode(int) method, if the code matches - // it will return the enum value. - - CONNECTED(new int[] { - 0x40001 // GLFW.GLFW_CONNECTED / LWJGL3 - }), - - DISCONNECTED(new int[] { - 0x40002 // GLFW.GLFW_DISCONNECTED / LWJGL3 - }), - - UNKNOWN(new int[0]); - - private int[] codes; - - JoystickState(int[] codes) { - this.codes = codes; - } - - private int[] getCodes() { - return codes; - } - - public static JoystickState fromCode(int value) { - - for (JoystickState state : values()) { - for (int code : state.getCodes()) { - if (value == code) { - return state; - } - } - } - - return UNKNOWN; - } + Connected, + Disconnected, }