InputComponent
Description
An abstract class that will be inherited by all listeners. Holds all needed methods and attributes that all listeners share.
Relationships
- InputManager : Will be made and used in the InputManager
- Is inherited by: ButtonPressListener , ButtonStateListener , TriggerPressListener , TriggerStateListener , TriggerPressureListener , ThumbstickMoveListener
Members
- delegate ButtonEvent() - delegate that holds the function to call for anything dealing with buttons, triggers, and thumbsticks
- delegate TriggerEvent(float degree) - delegate that holds the function to call for trigger pressure (for soft-possession control)
- ButtonEvent downFunction - function to call when the button is down
- ButtonEvent upFunction - function to call when the button is up
- TriggerEvent downFunction - function to call when the trigger is down
- TriggerEvent upFunction - function to call when the trigger is up
- Buttons currentButton - what button we're checking
- bool isStateUp - if the state of the button/trigger is up or down
Methods
- Update(GamePadState padState)
- abstract update that won't do anything - padState is needed to check what state the Button/Trigger is in.
- InputComponent(Buttons buttonToCheck, ButtonEvent upFunc, ButtonEvent downFunc)
- Constructor that accepts a button, what happens when the button is up and what happens when the button is pressed
- InputComponent(bool useRightTrigger, float triggerThreshold, TriggerEvent upFunc, TriggerEvent downFunc)
- Constructor that accepts a trigger, a threshold for when the event should fire, what happens when the trigger is up and what happens when the trigger is being pressed