|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.properties.SuspendableTimer
A proxy for a repeating timer that knows how to stop when the target's map suspends (or unloads), and resume when the target's map resumes.
Constructor Summary | |
SuspendableTimer(Timed target,
long period)
Constructs a new SuspendableTimer for the specified target object. |
Method Summary | |
protected void |
addHooks(GameMap map)
Adds the map hooks. |
protected void |
killTimer()
Kills the timer. |
void |
methodCalled(java.lang.String hookName,
MethodHookable target,
java.lang.Object data)
The map suspend/unload/resume method-hook was called. |
protected void |
removeHooks(GameMap map)
Removes hooks |
void |
start(GameMap map)
Starts the timer. |
protected void |
startTimer()
Starts the timer up. |
void |
stop()
Stops the timer and removes the hooks from the map. |
void |
timerExpired()
Timer went off. |
java.lang.String |
toString()
Prints debugging string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SuspendableTimer(Timed target, long period)
period
- the timer delay/period in millistarget
- the object to call back when our timer goes offMethod Detail |
public void start(GameMap map)
public void stop()
protected void addHooks(GameMap map)
protected void removeHooks(GameMap map)
public void methodCalled(java.lang.String hookName, MethodHookable target, java.lang.Object data)
methodCalled
in interface MethodHookCallback
hookName
- the name of the hook being runtarget
- the object on which the method was invoked:
a GameMap or GameObject.data
- a method-specific data object; can be null.
Check the documentation for the method hook to see if
any data is passed to the callbacks.protected void startTimer()
protected void killTimer()
public void timerExpired()
timerExpired
in interface Timed
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |