Package com.dragonboatrace.tools
Class CollidableTimer
- java.lang.Object
-
- com.dragonboatrace.tools.CollidableTimer
-
public class CollidableTimer extends java.lang.Object
Asynchronous timer used for powerups which need to be timed out.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
CollidableTimer.RunTask
A task class, inheriting from TimerTask.
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Timer
timer
The actual timer object.
-
Constructor Summary
Constructors Constructor Description CollidableTimer(float seconds, java.lang.Runnable effect)
Instantiate teh timer and schedule a task to get executed.
-
-
-
Constructor Detail
-
CollidableTimer
public CollidableTimer(float seconds, java.lang.Runnable effect)
Instantiate teh timer and schedule a task to get executed.- Parameters:
seconds
- how long should the timer run foreffect
- function interface which is ran whe the timer expires. (in the form of a java Runnable)
-
-