Class 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.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • timer

        java.util.Timer timer
        The actual timer object.
    • 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 for
        effect - function interface which is ran whe the timer expires. (in the form of a java Runnable)