|
Carpenter Engine
A C++ game engine with a build once run anywhere solution
|
A class used to represent a single input in an InputManager. More...
#include <Input.hpp>
Public Member Functions | |
| Input (InputParams params) | |
| The main constructor intended to be used by an InputManager. | |
| Input () | |
| ~Input () | |
| void | Update () |
| Updates the state of each possible input solution. | |
| bool | IsPressed () const |
| Checks if the input is just pressed. | |
| bool | IsReleased () const |
| Checks if the input is just released. | |
| bool | IsDown () const |
| Checks if the input is down. | |
| float | Strength () const |
| char | GetInput (InputDevice mode) const |
Public Attributes | |
| float | currentStrength = 0 |
A class used to represent a single input in an InputManager.
Used as a compositional class to the InputManager class, this object will get linked to an input device singleton.
Your input is a combination of the following:
| Engine::Input::Input::Input | ( | InputParams | params | ) |
The main constructor intended to be used by an InputManager.
Takes in a keycode, mouse button, and/or gamepad input in that order. The input will automatically be linked to one of the possible input device classes.
| params | The parameters of the input |
|
inline |
@breif Base Constructor
The default constructor that is not linked to any input.
| Engine::Input::Input::~Input | ( | ) |
Object Destructor
| char Engine::Input::Input::GetInput | ( | InputDevice | mode | ) | const |
Returns the input parameter for the given device
These are the specific cases based on the input device:
| mode | The input device |
| bool Engine::Input::Input::IsDown | ( | ) | const |
Checks if the input is down.
| bool Engine::Input::Input::IsPressed | ( | ) | const |
Checks if the input is just pressed.
| bool Engine::Input::Input::IsReleased | ( | ) | const |
Checks if the input is just released.
| float Engine::Input::Input::Strength | ( | ) | const |
Returns the input strength of the current input
| void Engine::Input::Input::Update | ( | ) |
Updates the state of each possible input solution.
Override currentStrength first with a value between 0 and 1 to indicate the strength of the input to update to. This will update pressed, released, and strength values of the input.