Dauphine  0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InputHandler Class Reference

Handles player input. More...

#include <InputHandler.h>

Public Member Functions

 InputHandler ()
 The constructor. More...
 
 ~InputHandler ()
 The destructor. More...
 
void handleInput ()
 Handles the input. More...
 
std::array< bool, GameKeys::MAX > getKeyStates ()
 
bool isQuitFlag ()
 

Private Member Functions

void signalExit ()
 Sets InputHandler::quitFlag to true.
 

Private Attributes

ControllerHandlercontrollerHandler
 Handles input if joystick is present. More...
 
std::array< bool, GameKeys::MAX > keyStates
 
                   Boolean array that controls which keys are

pressed or not. More...

 
SDL_Event sdlEvent
 SDL internal event structure. More...
 
bool quitFlag
 If the quit signal was recieved or not. More...
 

Detailed Description

Handles player input.

Using SDL event handling, recieves the player input accordingly.

Constructor & Destructor Documentation

InputHandler::InputHandler ( )

The constructor.

Used to create the input handler instance.

InputHandler::~InputHandler ( )

The destructor.

Deletes the InputHandler instance.

Member Function Documentation

std::array< bool, GameKeys::MAX > InputHandler::getKeyStates ( )
void InputHandler::handleInput ( )

Handles the input.

Detects the pending events, and handles them appropriately.

bool InputHandler::isQuitFlag ( )

Member Data Documentation

ControllerHandler* InputHandler::controllerHandler
private

Handles input if joystick is present.

std::array<bool, GameKeys::MAX> InputHandler::keyStates
private

                   Boolean array that controls which keys are

pressed or not.

bool InputHandler::quitFlag
private

If the quit signal was recieved or not.

SDL_Event InputHandler::sdlEvent
private

SDL internal event structure.


The documentation for this class was generated from the following files: