Class GMTimes
java.lang.Object
com.djrapitops.plan.gathering.domain.TimeKeeper
com.djrapitops.plan.gathering.domain.GMTimes
TimeKeeper class that tracks the time spent in each GameMode based on Playtime.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.djrapitops.plan.gathering.domain.TimeKeeper
lastStateChange, state, times -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]getState()static StringmagicNumberToGMName(int magicNumber) voidresetTimes(long time) voidsetAllGMTimes(long... times) Sets times for all 4 gamemodes.toJson()toString()Methods inherited from class com.djrapitops.plan.gathering.domain.TimeKeeper
addTime, changeState, equals, getLastStateChange, getTime, getTimes, getTotal, hashCode, renameState, resetState, resetState, setLastStateChange, setState, setTime, setTimes
-
Field Details
-
SURVIVAL
- See Also:
-
CREATIVE
- See Also:
-
ADVENTURE
- See Also:
-
SPECTATOR
- See Also:
-
-
Constructor Details
-
GMTimes
-
GMTimes
-
GMTimes
-
GMTimes
-
GMTimes
public GMTimes()
-
-
Method Details
-
getGMKeyArray
-
magicNumberToGMName
-
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
- Overrides:
getStatein classTimeKeeper
-
toString
- Overrides:
toStringin classTimeKeeper
-
toJson
-