Class Timer

java.lang.Object
com.deco2800.game.utils.random.Timer

public class Timer extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    long
    Initiating the delay variable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Timer(int lowerIntervalSeconds, int upperIntervalSeconds)
    Setting up timer to the class variable.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Updates flags and returns them.
    void
    Initialize delay intervals.
    boolean
    Checking whether if the timer is already expired or not.
    void
    Setting up the start variable to the current time.
    long
    Checking whether if the timer is already expired or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delay

      public long delay
      Initiating 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 value
      upperIntervalSeconds - 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.