Nimbus
0.2
A game... with arrows... which should be clouds
|
#include <InputManager.h>
Public Member Functions | |
InputManager (void) | |
virtual void | initialize (void) |
virtual bool | update (void) |
virtual void | pause (void) |
virtual void | stop (void) |
Manager to bind input to events in the game.
Events should be passed through the event callback system so that in game activities are not associated directly to keys, but rather to generic event calls created by key presses.
The input manager uses buffered input because buffered input is better than polled input. This of course is not true, but for some reason, callbacks seem cleaner. So we'll use them if possible. If polling is necessary, we have an update function. At the moment, this only does generic input checks, and this is probably for the best.
Currently, the input manager is a single monolithic class for handling game input. As a design decision, input managers could be made specific to each RunMode. That way input in a menu would be handled differently than in the game.
The other possibility is to simply send off events regardless of the mode. Since no listeners would be registered, the only adverse effect would be a few (< 5?) extra function calls per input action caught.
InputManager::InputManager | ( | void | ) |
Constructs the input manager.
|
inlinevirtual |
The initial initialization function.
Implements Nimbus::Manager.
|
virtual |
The super complex update function.
Implements Nimbus::Manager.