package input; public enum Button { UP, DOWN, LEFT, RIGHT, A, B, C, D; public int toInt() { switch (this) { case UP : return 0; case DOWN : return 1; case LEFT : return 2; case RIGHT : return 3; case A : return 4; case B : return 5; case C : return 6; case D : return 7; default : return -1; } } }