Class WorldTimes
java.lang.Object
com.djrapitops.plan.gathering.domain.WorldTimes
Class that tracks the time spent in each World based on GMTimes.
-
Constructor Summary
ConstructorsConstructorDescriptionWorldTimes(String startingWorld, String startingGM, long time) Creates a new Empty WorldTimes object.WorldTimes(Map<String, GMTimes> times) Re-Creates an existing WorldTimes object for viewing. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(WorldTimes toAdd) booleanbooleangetGMTimes(String world) Used for Quick access to time of each GameMode.longgetTotal()longgetWorldPlaytime(String world) Used to get a total playtime of a world.inthashCode()booleanisEmpty()voidsetAll(WorldTimes worldTimes) voidsetGMTimesForWorld(String world, GMTimes gmTimes) toJson()toString()voidupdateState(long changeTime) Updates the state at the end of the session.voidupdateState(String worldName, String gameMode, long changeTime) Updates the time status to match the new state.
-
Constructor Details
-
WorldTimes
-
WorldTimes
-
WorldTimes
public WorldTimes()
-
-
Method Details
-
updateState
public void updateState(long changeTime) Updates the state at the end of the session. Does not change world or GameMode.- Parameters:
changeTime- epoch ms session ended.
-
updateState
-
getWorldPlaytime
Used to get a total playtime of a world.- Parameters:
world- World name being checked.- Returns:
- total milliseconds spent in a world.
-
getTotal
public long getTotal() -
getGMTimes
Used for Quick access to time of each GameMode.Should not be used for changing state, because if player has not played in the world, an empty GMTimes is given, with 0 as playtime
- Parameters:
world- World name being checked.- Returns:
- GMTimes object with play times of each GameMode.
-
getWorldTimes
-
computeWorldTimes
-
computeGMTimes
-
setGMTimesForWorld
-
equals
-
hashCode
-
toString
-
getCurrentWorld
-
add
-
contains
-
isEmpty
public boolean isEmpty() -
setAll
-
toJson
-