diff --git a/build.gradle b/build.gradle index e4a519d..d1c71e0 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ def ROBOT_CLASS = "frc.robot.Robot" apply plugin: 'idea' -version = '3.0.2' +version = '4.0.0' sourceSets { main.java.srcDirs = ['src'] diff --git a/src/harkerrobolib/wrappers/HSGamepad.kt b/src/harkerrobolib/wrappers/HSGamepad.kt index 010e5fd..e6588aa 100644 --- a/src/harkerrobolib/wrappers/HSGamepad.kt +++ b/src/harkerrobolib/wrappers/HSGamepad.kt @@ -12,7 +12,10 @@ abstract class HSGamepad(port: Int, buttonStartPort: Int, buttonSelectPort: Int, buttonStickLeftPort: Int, buttonStickRightPort: Int, buttonBumperLeftPort: Int, buttonBumperRightPort: Int, - private val axisLeftX: Int, private val axisLeftY: Int, private val axisRightX: Int, private val axisRightY: Int) : Joystick(port) { + private val axisLeftX: Int, private val axisLeftY: Int, private val axisRightX: Int, private val axisRightY: Int) : + Joystick(port) { + + /** * Gets an instance of Button A * @return An instance of the button @@ -64,6 +67,19 @@ abstract class HSGamepad(port: Int, */ val buttonBumperRight: HSJoystickButton + init { + buttonA = HSJoystickButton(this, buttonAPort) + buttonB = HSJoystickButton(this, buttonBPort) + buttonX = HSJoystickButton(this, buttonXPort) + buttonY = HSJoystickButton(this, buttonYPort) + buttonStart = HSJoystickButton(this, buttonStartPort) + buttonSelect = HSJoystickButton(this, buttonSelectPort) + buttonStickLeft = HSJoystickButton(this, buttonStickLeftPort) + buttonStickRight = HSJoystickButton(this, buttonStickRightPort) + buttonBumperLeft = HSJoystickButton(this, buttonBumperLeftPort) + buttonBumperRight = HSJoystickButton(this, buttonBumperRightPort) + } + /** * Gets the X value being input to the left joystick. * @return the left X value @@ -175,17 +191,4 @@ abstract class HSGamepad(port: Int, */ val buttonBumperRightState: Boolean get() = buttonBumperRight.get() - - init { - buttonA = HSJoystickButton(this, buttonAPort) - buttonB = HSJoystickButton(this, buttonBPort) - buttonX = HSJoystickButton(this, buttonXPort) - buttonY = HSJoystickButton(this, buttonYPort) - buttonStart = HSJoystickButton(this, buttonStartPort) - buttonSelect = HSJoystickButton(this, buttonSelectPort) - buttonStickLeft = HSJoystickButton(this, buttonStickLeftPort) - buttonStickRight = HSJoystickButton(this, buttonStickRightPort) - buttonBumperLeft = HSJoystickButton(this, buttonBumperLeftPort) - buttonBumperRight = HSJoystickButton(this, buttonBumperRightPort) - } }