|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.gameengine.icadroids.alarms.Alarm
public class Alarm
Set alarms who will trigger after a specified time. Time is measured in cycles of the game loop. Alarms will trigger a method (specified in IAlarm) after the given time To make use of alarms, create a alarm object. This alarm will start immediately.
Constructor Summary | |
---|---|
Alarm(int id,
int Time,
IAlarm alarmedObject)
Create a new Alarm with the given time. |
Method Summary | |
---|---|
void |
pauseAlarm()
Pause the alarm, it will stop ticking. |
void |
restartAlarm()
Reset the clock to zero and start the alarm |
void |
setTime(int time)
Change the time of the alarm. |
void |
startAlarm()
Restart an alarm without resetting the clock. |
boolean |
targets(IAlarm ia)
Test if this alarm targets the specified Object (that must implement IAlarm) |
void |
update()
Update will be triggered by the GameEngine every update. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Alarm(int id, int Time, IAlarm alarmedObject)
id
- ID to identify the alarmTime
- How many updates must occur before the alarm goes offalarmedObject
- The object that must be informed when the alarm goes offMethod Detail |
---|
public final void update()
public final void pauseAlarm()
public final void startAlarm()
public final void restartAlarm()
public final void setTime(int time)
time
- The timepublic boolean targets(IAlarm ia)
ia
- The object you want want to test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |