Skip to content

Commit

Permalink
Formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnototesLaptop authored and kevinfrei committed Nov 3, 2023
1 parent a855b9b commit d5018a5
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
package com.technototes.library.control;

import com.technototes.library.command.Command;

import java.util.function.DoubleSupplier;
import java.util.function.Function;

/** Class for command axis for the gamepad
/**
* Class for command axis for the gamepad
*
* @author Alex Stedman
*/
public class CommandAxis extends AxisBase implements CommandInput<CommandAxis> {

/** Make a command axis
/**
* Make a command axis
*
* @param supplier The axis supplier
*/
public CommandAxis(DoubleSupplier supplier) {
super(supplier);
}

/** Make a command axis
/**
* Make a command axis
*
* @param supplier The axis supplier
* @param supplier The axis supplier
* @param threshold The threshold to trigger to make the axis behave as a button
*/
public CommandAxis(DoubleSupplier supplier, double threshold) {
Expand Down Expand Up @@ -55,6 +60,6 @@ public CommandButton getAsButton() {
}

public CommandButton getAsButton(double threshold) {
return new CommandButton(() -> threshold >= 0 ? getAsDouble() >= threshold : getAsDouble() < threshold);
return new CommandButton(() -> (threshold >= 0) ? (getAsDouble() >= threshold) : (getAsDouble() < threshold));
}
}

0 comments on commit d5018a5

Please sign in to comment.