26 lines
530 B
Java
26 lines
530 B
Java
package engine.input;
|
|
|
|
import java.util.List;
|
|
|
|
public class Button {
|
|
|
|
public String name;
|
|
private final List<Integer> buttons;
|
|
private final GamepadInput controller;
|
|
|
|
public Button(String name, List<Integer> buttons, GamepadInput controller){
|
|
this.name = name;
|
|
this.buttons = buttons;
|
|
this.controller = controller;
|
|
}
|
|
|
|
public boolean isButtonPressed(){
|
|
for (int i : buttons){
|
|
if (controller.checkPressed(i)) return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
}
|