Manages the registration and processing of alarms for GameObjects. More...
#include <AlarmableManager.h>
Public Types | |
enum class | ALARM_ID { ALARM_0 , ALARM_1 , ALARM_2 } |
Enum class representing the alarm IDs. | |
using | StorageMapRef = TimeLineMap::iterator |
Type alias for the storage map iterator. | |
Public Member Functions | |
AlarmableManager (const AlarmableManager &)=delete | |
AlarmableManager & | operator= (const AlarmableManager &)=delete |
void | Register (Alarmable *al, ALARM_ID id, float t) |
Registers an alarm for a GameObject. | |
void | Deregister (Alarmable *al, ALARM_ID id) |
Deregisters an alarm for a GameObject. | |
void | ProcessAlarms () |
Processes all alarms; triggers and removes expired alarms. | |
Static Public Attributes | |
static const int | ALARM_NUMBER = 3 |
The number of alarms. | |
Private Types | |
using | AlarmEvent = std::pair<Alarmable*, ALARM_ID> |
Type alias for the alarm event pair. | |
using | TimeLineMap = std::multimap<float, AlarmEvent> |
Type alias for the timeline map of alarms. | |
Private Attributes | |
TimeLineMap | timeline |
The timeline map of alarms. | |
Manages the registration and processing of alarms for GameObjects.
The AlarmableManager class is responsible for managing the registration and processing of alarms for GameObjects. It provides methods to register, deregister, and process alarms.
Deregisters an alarm for a GameObject.
al | Pointer to the GameObject. |
id | The alarm ID to deregister. |
Registers an alarm for a GameObject.
al | Pointer to the GameObject. |
id | The alarm ID to register. |
t | The time duration for the alarm. |