A virtual derived class of GameObject that allows the GameObject to set alarms. More...
#include <Alarmable.h>
Detailed Description
A virtual derived class of GameObject that allows the GameObject to set alarms.
A class that inherits from Alarmable gains access to the Alarm functions. These allow the user to execute code after a set delay. Each alarmable derived class can have up to three defined alarms: Alarm0(), Alarm1(), and Alarm2().
Protected Member Functions | |
void | SetAlarm (const float &seconds, const AlarmID &aID) |
Function to register when a specified alarm is to be triggered. More... | |
void | StopAlarm (const AlarmID &aID) |
Function to deregister specified alarm from being triggered. More... | |
virtual void | Alarm0 () |
Function which is called if set by the user. More... | |
virtual void | Alarm1 () |
Function which is called if set by the user. More... | |
virtual void | Alarm2 () |
Function which is called if set by the user. More... | |
![]() | |
virtual void | SceneEntry ()=0 |
Function which is called upon a registered scene entry. More... | |
virtual void | SceneExit ()=0 |
Function which is called upon a registered scene exit. More... | |
Additional Inherited Members | |
![]() | |
void | SubmitEntry () |
Public Function to register a call for the GameObject's SceneEntry() function. More... | |
void | SubmitExit () |
Public Function to register a call for the GameObject's SceneEntry() function. More... | |
Member Function Documentation
|
inlineprotectedvirtual |
Function which is called if set by the user.
This is a virtual function to be overriden by the user. If the specified alarm is set, the Alarm() function will be called by the AlarmableManager after the set time runs out. The alarm can be set by using the SetAlarm() and StopAlarm() functions.
|
inlineprotectedvirtual |
Function which is called if set by the user.
This is a virtual function to be overriden by the user. If the specified alarm is set, the Alarm() function will be called by the AlarmableManager after the set time runs out. The alarm can be set by using the SetAlarm() and StopAlarm() functions.
|
inlineprotectedvirtual |
Function which is called if set by the user.
This is a virtual function to be overriden by the user. If the specified alarm is set, the Alarm() function will be called by the AlarmableManager after the set time runs out. The alarm can be set by using the SetAlarm() and StopAlarm() functions.
|
protected |
Function to register when a specified alarm is to be triggered.
When the SetAlarm() function is called, a float for number of seconds and an AlarmID reference is passed. The seconds parameter determines how many seconds from the current time that the alarm function be called. The aID parameter specifies which alarm function should be called. The AlarmID enum is mapped to the alarm functions like so:
- Parameters
-
seconds The number of seconds the alarm is to be set for (starting at the current time). aID The ID to specify which alarm to set.
|
protected |
Function to deregister specified alarm from being triggered.
The StopAlarm() function will end the countdown ofa specified function, thus stopping the alarm function from being triggered if it is currently registered. The aID parameter specifies which alarm function should be called. The AlarmID enum is mapped to the alarm functions like so:
- Parameters
-
aID The ID to specify which alarm to stop.