Package com.simsilica.lemur.input
Class StateMethodDelegate
java.lang.Object
com.simsilica.lemur.input.StateMethodDelegate
- All Implemented Interfaces:
StateFunctionListener
A convenience StateFunctionListener implementation that
can call a method using reflection. By default, the method
is called on the "release" of a particular function, ie: when
its state returns to Off. Methods that take an InputState
argument and are called by a StateMethodDelegate with the
"takesArgument" parameter as 'true' will receive all events,
POSTIVE, Negative, and Off.
-
Constructor Summary
ConstructorsConstructorDescriptionStateMethodDelegate
(Object target, String method) StateMethodDelegate
(Object target, String method, boolean takesArgument) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
callMethod
(InputState state) protected static Method
resolveMethod
(Class targetClass, String name, boolean takesArgument) void
valueChanged
(FunctionId func, InputState value, double tpf)
-
Constructor Details
-
StateMethodDelegate
-
StateMethodDelegate
-
-
Method Details
-
getTarget
-
getMethodName
-
resolveMethod
-
callMethod
-
valueChanged
- Specified by:
valueChanged
in interfaceStateFunctionListener
-