Manages the registration and processing of a single key event for GameObjects. More...
#include <SingleKeyEventManager.h>
Public Member Functions | |
SingleKeyEventManager (const SingleKeyEventManager &)=delete | |
SingleKeyEventManager & | operator= (const SingleKeyEventManager &)=delete |
SingleKeyEventManager (AZUL_KEY k) | |
Constructor for SingleKeyEventManager with a key. | |
void | Register (Inputable *in, EventType e) |
Registers a GameObject for a key event. | |
void | Deregister (Inputable *in, EventType e) |
Deregisters a GameObject for a key event. | |
void | ProcessKeyEvent () |
Processes the key event for all registered GameObjects. | |
bool | IsEmpty () |
Checks if there are no registered GameObjects. | |
Private Types | |
using | InputableCollection = std::list<Inputable*> |
Type alias for the collection of inputable GameObjects. | |
using | CollectionIterator = InputableCollection::iterator |
Type alias for the collection iterator. | |
Private Attributes | |
AZUL_KEY | key |
The key associated with this manager. | |
InputableCollection | keyInactiveCol |
Collection of GameObjects for key inactive events. | |
InputableCollection | keyPressCol |
Collection of GameObjects for key press events. | |
InputableCollection | keyHeldCol |
Collection of GameObjects for key held events. | |
InputableCollection | keyReleaseCol |
Collection of GameObjects for key release events. | |
EventType | eventState |
The current event state of the key. | |
Manages the registration and processing of a single key event for GameObjects.
The SingleKeyEventManager class is responsible for managing the registration and processing of a single key event for GameObjects. It provides methods to register, deregister, and process the key event.
SingleKeyEventManager::SingleKeyEventManager | ( | AZUL_KEY | k | ) |
Constructor for SingleKeyEventManager with a key.
k | The key associated with this manager. |
Deregisters a GameObject for a key event.
in | Pointer to the GameObject. |
e | The event type to deregister. |
bool SingleKeyEventManager::IsEmpty | ( | ) |
Checks if there are no registered GameObjects.
Registers a GameObject for a key event.
in | Pointer to the GameObject. |
e | The event type to register. |