Class TimerFeature

java.lang.Object
me.hsgamer.minigamecore.feature.TimerFeature
All Implemented Interfaces:
Feature, Initializer

public class TimerFeature extends Object implements Feature
The timer feature, which provides duration
  • Constructor Details

    • TimerFeature

      public TimerFeature()
  • Method Details

    • getDuration

      public long getDuration()
      Get the duration of the timer in milliseconds
      Returns:
      the duration
    • setDuration

      public void setDuration(long duration)
      Set the duration of the timer in milliseconds
      Parameters:
      duration - the duration
    • getDuration

      public long getDuration(TimeUnit unit)
      Get the duration of the timer
      Parameters:
      unit - the time unit of the duration
      Returns:
      the duration
    • setDuration

      public void setDuration(long duration, TimeUnit unit)
      Set the duration of the timer
      Parameters:
      duration - the duration
      unit - the time unit of the duration
    • isRunning

      public boolean isRunning()
      Check if the timer is running
      Returns:
      true if it is
    • isNotRunning

      public boolean isNotRunning()
      Check if the timer is not running
      Returns:
      true if it is
    • clear

      public void clear()
      Description copied from interface: Initializer
      Clear the object
      Specified by:
      clear in interface Initializer