Base class for objects that can have alarms triggered in the game loop. More...
#include <Alarmable.h>
Classes | |
struct | RegistrationData |
Structure to hold registration data for alarms. More... | |
Protected Member Functions | |
Alarmable (const Alarmable &)=delete | |
Alarmable & | operator= (const Alarmable &)=delete |
void | SubmitAlarmRegistration (AlarmableManager::ALARM_ID id, float t) |
Submits the alarm registration for the GameObject. | |
void | SubmitAlarmDeregistration (AlarmableManager::ALARM_ID id) |
Submits the alarm deregistration for the GameObject. | |
bool | IsAlarmRegistered (AlarmableManager::ALARM_ID id) |
Checks if the given alarm is currently registered. | |
Private Member Functions | |
virtual void | Alarm0 () |
Virtual method to be implemented by derived classes for alarm 0 when triggered. | |
virtual void | Alarm1 () |
Virtual method to be implemented by derived classes for alarm 1 when triggered. | |
virtual void | Alarm2 () |
Virtual method to be implemented by derived classes for alarm 2 when triggered. | |
void | AlarmRegistration (AlarmableManager::ALARM_ID id, float t) |
Registers the GameObject for alarms in the scene. | |
void | AlarmDeregistration (AlarmableManager::ALARM_ID id) |
Deregisters the GameObject from alarms in the scene. | |
void | TriggerAlarm (AlarmableManager::ALARM_ID id) |
Triggers the alarm for the GameObject. | |
int | GetAlarmRegInt (AlarmableManager::ALARM_ID id) |
Gets the integer representation of the alarm registration state. | |
Private Attributes | |
RegistrationData | RegData [AlarmableManager::ALARM_NUMBER] |
Array to hold registration data for all alarms. | |
Friends | |
class | AlarmableAttorney |
Base class for objects that can have alarms triggered in the game loop.
The Alarmable
class provides a base implementation for objects that need to have alarms triggered during the game loop. It manages registration and deregistration with the AlarmableManager
and provides virtual alarm methods that can be overridden by derived classes.
|
private |
Deregisters the GameObject from alarms in the scene.
id | The alarm ID to deregister. |
|
private |
Registers the GameObject for alarms in the scene.
id | The alarm ID to register. |
t | The time duration for the alarm. |
|
private |
Gets the integer representation of the alarm registration state.
id | The alarm ID. |
|
protected |
Checks if the given alarm is currently registered.
id | The alarm ID to check. |
|
protected |
Submits the alarm deregistration for the GameObject.
id | The alarm ID to deregister. |
|
protected |
Submits the alarm registration for the GameObject.
id | The alarm ID to register. |
t | The time duration for the alarm. |
|
private |
Triggers the alarm for the GameObject.
id | The alarm ID to trigger. |