InputManager

Description

Will deal with specific controller input types. For each controller type it will have events that will be checked and fired, such as the A button being pressed or held down. It will also maintain a number of control schemes, each specified for a certain game state which will further break down which events will be checked and fired. Other classes that require checks to input can subscribe to those events using delegates.

Relationships

  • Window : Made in the Window class. Will access the game state from there so it knows which control scheme to use.
  • InputComponent : Will have InputComponents which will hold the listeners for different buttons

Members

  • List<InputComponent> components - list of all listeners for the controller

Methods

  • Update(GamePadState padState)
    • will call update on the input components that are needed based on the control scheme
  • addTriggerStateListener(bool useRightTrigger, float triggerThreshold, ButtonEvent upFunc, ButtonEvent downFunc)
    • adds a trigger state listener to the component list to update with associated trigger
  • addTriggerPressureListener(bool useRightTrigger, float triggerThreshold, TriggerEvent upFunc, TriggerEvent downFunc)
    • adds a trigger pressure listener to the component list to update with associated trigger
  • addTriggerPressListener(bool useRightTrigger, float triggerThreshold, ButtonEvent upFunc, ButtonEvent downFunc)
    • adds a trigger press listener to the component list to update with associated trigger
  • addButtonStateListener(Buttons buttonToCheck, ButtonEvent upFunc, ButtonEvent downFunc)
    • adds a button state listener to the component list to update with associated button
  • addButtonPressListener(Buttons buttonToCheck, ButtonEvent upFunc, ButtonEvent downFunc)
    • adds a button press listener to the component list to update with associated button
  • addThumbstickMoveListener(ThumbstickDirection direction, float sensitivityThreshold, ButtonEvent upFunc, ButtonEvent downFunc)
    • adds a thumbstick move listener to the component list to update with associated thumbstick and direction
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License