Package com.deco2800.game.utils.random
Class Timer
java.lang.Object
com.deco2800.game.utils.random.Timer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimer
(int lowerIntervalSeconds, int upperIntervalSeconds) Setting up timer to the class variable. -
Method Summary
Modifier and TypeMethodDescriptionbyte
Updates flags and returns them.void
Initialize delay intervals.boolean
Checking whether if the timer is already expired or not.void
start()
Setting up the start variable to the current time.long
timeLeft()
Checking whether if the timer is already expired or not.
-
Field Details
-
delay
public long delayInitiating the delay variable.
-
-
Constructor Details
-
Timer
public Timer(int lowerIntervalSeconds, int upperIntervalSeconds) Setting up timer to the class variable.- Parameters:
lowerIntervalSeconds
- is for the lowest possible randomization valueupperIntervalSeconds
- is for the highest possible randomization value
-
-
Method Details
-
initCompletionValues
public void initCompletionValues()Initialize delay intervals. -
start
public void start()Setting up the start variable to the current time. -
isTimerExpired
public boolean isTimerExpired()Checking whether if the timer is already expired or not. -
timeLeft
public long timeLeft()Checking whether if the timer is already expired or not. -
getFlagStatus
public byte getFlagStatus()Updates flags and returns them.
-