Package me.hsgamer.minigamecore.feature
Class TimerFeature
java.lang.Object
me.hsgamer.minigamecore.feature.TimerFeature
- All Implemented Interfaces:
Feature
,Initializer
The timer feature, which provides duration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the objectlong
Get the duration of the timer in millisecondslong
getDuration
(TimeUnit unit) Get the duration of the timerboolean
Check if the timer is not runningboolean
Check if the timer is runningvoid
setDuration
(long duration) Set the duration of the timer in millisecondsvoid
setDuration
(long duration, TimeUnit unit) Set the duration of the timerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.hsgamer.minigamecore.base.Initializer
init, postInit
-
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
Get the duration of the timer- Parameters:
unit
- the time unit of the duration- Returns:
- the duration
-
setDuration
Set the duration of the timer- Parameters:
duration
- the durationunit
- 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 interfaceInitializer
-