Package be.yildizgames.module.controller
Interface Controller
- All Known Implementing Classes:
ControllerRunner
public interface Controller
Controller.
- Author:
- Grégory Van den Borre
-
Method Summary
Modifier and Type Method Description voidaddListener(ControllerListener l)register a listener to receive event from the controller.StringgetModel()ControllerCurrentStategetState()Provide the controller current state.booleanisConnected()Check if the controller is currently plugged in.booleanisUsed()Check if the controller is in use.voidmap(ControllerMapper mapper)Map the buttons if a change is required.voiduse()Use this controller.voiduse(ThreadRunner runner)
-
Method Details
-
getState
ControllerCurrentState getState()Provide the controller current state. The state can be kept once retrieved, it will always be up to date.- Returns:
- The state.
-
addListener
register a listener to receive event from the controller.- Parameters:
l- Controller listener.
-
use
void use()Use this controller. -
use
-
map
Map the buttons if a change is required.- Parameters:
mapper- Button mapper.
-
isUsed
boolean isUsed()Check if the controller is in use.- Returns:
- True if the controller is used, false otherwise.
-
isConnected
boolean isConnected()Check if the controller is currently plugged in.- Returns:
- True if the controoler is connected, false otherwise.
-
getModel
String getModel()
-