@@ -0,0 +1,1825 @@
+package org.usfirst.frc2832.Robot_2016.HID;%0D%0A%0D%0Aimport java.io.Serializable;%0D%0A%0D%0Aimport edu.wpi.first.wpilibj.Joystick;%0D%0A%0D%0A/**%0D%0A * %3Cp%3E%0D%0A * An immutable gamepad object.  Treat this as a gamepad %22frozen in time%22.%0D%0A * This is to be used instead of the regular wpilib Joystick or GamepadDeadzoned%0D%0A * classes, for use with recordable autonomous.%0D%0A * %3C/p%3E%0D%0A * @author Brendan%0D%0A *%0D%0A */%0D%0Apublic class GamepadState implements Serializable %7B%0D%0A%09private static final long serialVersionUID = 9198171031103864921L;%0D%0A%09%0D%0A%09/**%0D%0A%09 * Indices for Xbox-based controllers%0D%0A%09 */%0D%0A%09public static final transient int%0D%0A%09%09BUTTON_A  = 0,%0D%0A%09%09BUTTON_B  = 1,%0D%0A%09%09BUTTON_X  = 2,%0D%0A%09%09BUTTON_Y  = 3,%0D%0A%09%09BUTTON_LB = 4,%0D%0A%09%09BUTTON_RB = 5,%0D%0A%09%09BUTTON_BACK = 6,%0D%0A%09%09BUTTON_START = 7,%0D%0A%09%09%0D%0A%09%09AXIS_RX = 0,%0D%0A%09%09AXIS_RY = 1,%0D%0A%09%09AXIS_LT = 2,%0D%0A%09%09AXIS_RT = 3,%0D%0A%09%09AXIS_LX = 4,%0D%0A%09%09AXIS_LY = 5;%0D%0A%09%0D%0A%09public final double axes%5B%5D;%0D%0A%09public final boolean buttons%5B%5D;%0D%0A%09public final int pov;%0D%0A%09%0D%0A%09/**%0D%0A%09 * Creates a new gamepad state based off of raw data. You probably don't want to use this, use makeState instead.%0D%0A%09 * @param axes%0D%0A%09 * @param buttons%0D%0A%09 * @param pov%0D%0A%09 * @see makeState%0D%0A%09 */%0D%0A%09public GamepadState(double axes%5B%5D, boolean buttons%5B%5D, int pov) %7B%0D%0A%09%09this.axes = axes.clone();%0D%0A%09%09this.buttons = buttons.clone();%0D%0A%09%09this.pov = pov;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Creates a new GamepadState based off of a gamepad's current state.%0D%0A%09 * @param j The gamepad object%0D%0A%09 * @return A gamepad state%0D%0A%09 */%0D%0A%09public static GamepadState makeState(Joystick j) %7B%0D%0A%09%09double%5B%5D axes = new double%5Bj.getAxisCount()%5D;%0D%0A%09%09for(int i = 0; i %3C axes.length; i ++)%0D%0A%09%09%09axes%5Bi%5D = j.getRawAxis(i);%0D%0A%09%09%0D%0A%09%09boolean%5B%5D buttons = new boolean%5Bj.getButtonCount()%5D;%0D%0A%09%09for(int i = 0; i %3C buttons.length; i ++)%0D%0A%09%09%09buttons%5Bi%5D = j.getRawButton(i + 1);%0D%0A%09%09%0D%0A%09%09return (new GamepadState(axes, buttons, j.getPOV()));%0D%0A%09%7D%0D%0A%7D%0D%0A

Add GamepadState