Bubba-3D  0.9.0
Awesome game engine!
Public Member Functions | Static Public Member Functions | List of all members
ControlsManager Class Reference

Public Member Functions

void addBinding (int function, Input *button)
 Adds a button to specified function. More...
 
void addBindings (int function, std::initializer_list< Input * > buttons)
 
void clearBindings ()
 
ControlStatus getStatus (int function)
 

Static Public Member Functions

static ControlsManagergetInstance ()
 Gets the singleton instance of the controls manager.
 

Detailed Description

Definition at line 60 of file ControlsManager.h.

Member Function Documentation

void ControlsManager::addBinding ( int  function,
Input button 
)

Adds a button to specified function.

See also
addBindings()

Definition at line 47 of file ControlsManager.cpp.

void ControlsManager::addBindings ( int  function,
std::initializer_list< Input * >  buttons 
)

Add several buttons to a function at once. This can also be used to rebind buttons. If a function already has a keyboard button and you add a new keyboard button, then the old one is removed. Any function can only have all dual buttons or all non-dual buttons. If a function is given buttons with different duality an exception is thrown with an error message.

Exceptions
std::stringIf a function is given buttons of different dualities.
Warning
A function can only have one assignment from one device. The turn function can't have both A/D and 'arrow left'/'arrow right' on the keyboard

Definition at line 51 of file ControlsManager.cpp.

void ControlsManager::clearBindings ( )

Clears all function bindings. This should only be used when the state of the game has changed and the controls are completely different. If you want to rebind a function use addBindings()

See also
addBindings()

Definition at line 43 of file ControlsManager.cpp.

ControlStatus ControlsManager::getStatus ( int  function)

Gets the status for the specified function. To see more on how to use the ControlStatus see the class documentation for ControlStatus.

See also
ControlStatus

Definition at line 96 of file ControlsManager.cpp.


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