Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Change order of HSGamepad class
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnitoProductions committed Nov 1, 2018
1 parent 13abf2f commit 8800628
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
31 changes: 17 additions & 14 deletions src/harkerrobolib/wrappers/HSGamepad.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 8800628

Please sign in to comment.