Class GMTimes

java.lang.Object
com.djrapitops.plan.gathering.domain.TimeKeeper
com.djrapitops.plan.gathering.domain.GMTimes

public class GMTimes extends TimeKeeper
TimeKeeper class that tracks the time spent in each GameMode based on Playtime.
  • Constructor Details

    • GMTimes

      public GMTimes(Map<String,Long> times, String lastState, long lastStateChange)
    • GMTimes

      public GMTimes(String lastState, long lastStateChange)
    • GMTimes

      public GMTimes(String lastState)
    • GMTimes

      public GMTimes(Map<String,Long> times)
    • GMTimes

      public GMTimes()
  • Method Details

    • getGMKeyArray

      public static String[] getGMKeyArray()
    • magicNumberToGMName

      public static String magicNumberToGMName(int magicNumber)
    • getMostUsedGameMode

      public Optional<String> getMostUsedGameMode()
    • setAllGMTimes

      public void setAllGMTimes(long... times)
      Sets times for all 4 gamemodes.

      Give 1 - 4 parameters. times starts from Survival, ends in Spectator.

      Given too few parameters (Under 4, rest are set as 0L) Extra parameters are ignored (Over 4)

      Parameters:
      times - 1-4 time parameters.
      Throws:
      IllegalArgumentException - If any parameter is null.
    • resetTimes

      public void resetTimes(long time)
    • getState

      public String getState()
      Overrides:
      getState in class TimeKeeper
    • toString

      public String toString()
      Overrides:
      toString in class TimeKeeper
    • toJson

      public String toJson()