Package com.pocolifo.robobase.control
Class OneTimeControl
java.lang.Object
com.pocolifo.robobase.control.OneTimeControl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanget()Get the current toggled state.onToggleOn(Runnable runnable) Run code when thisOneTimeControlis toggled ON.Updates this Toggleable.
-
Constructor Details
-
OneTimeControl
Creates aToggleable.- Parameters:
currentState- A method to get the current state of something (like whether a gamepad button is pressed)
-
-
Method Details
-
get
public boolean get()Get the current toggled state.- Returns:
- The toggled state of this
OneTimeControl
-
processUpdates
Updates this Toggleable. Should be called ONCE as frequent as possible or in the main loop!- Returns:
- This
OneTimeControlinstance.
-
onToggleOn
Run code when thisOneTimeControlis toggled ON.- Parameters:
runnable- ARunnablethat is executed when this toggleable is toggled ON.- Returns:
- This
OneTimeControlinstance.
-