public class WorldTimes
extends java.lang.Object
Constructor and Description |
---|
WorldTimes() |
WorldTimes(java.util.Map<java.lang.String,GMTimes> times)
Re-Creates an existing WorldTimes object for viewing.
|
WorldTimes(java.lang.String startingWorld,
java.lang.String startingGM,
long time)
Creates a new Empty WorldTimes object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(WorldTimes toAdd) |
boolean |
contains(java.lang.String worldName) |
boolean |
equals(java.lang.Object o) |
java.util.Optional<java.lang.String> |
getCurrentWorld() |
GMTimes |
getGMTimes(java.lang.String world)
Used for Quick access to time of each GameMode.
|
long |
getTotal() |
long |
getWorldPlaytime(java.lang.String world)
Used to get a total playtime of a world.
|
java.util.Map<java.lang.String,GMTimes> |
getWorldTimes() |
int |
hashCode() |
void |
setGMTimesForWorld(java.lang.String world,
GMTimes gmTimes) |
java.lang.String |
toString() |
void |
updateState(long changeTime)
Updates the state at the end of the session.
|
void |
updateState(java.lang.String worldName,
java.lang.String gameMode,
long changeTime)
Updates the time status to match the new state.
|
public WorldTimes(java.lang.String startingWorld, java.lang.String startingGM, long time)
startingWorld
- World to start the calculations at.startingGM
- GameMode to start the calculations at.time
- Epoch ms the time calculation should startpublic WorldTimes(java.util.Map<java.lang.String,GMTimes> times)
times
- Map of each World's GMTimes object.public WorldTimes()
public void updateState(long changeTime)
changeTime
- epoch ms session ended.public void updateState(java.lang.String worldName, java.lang.String gameMode, long changeTime)
worldName
- World name of the world swapped to.gameMode
- GameMode name of the gm swapped to.changeTime
- Epoch ms the change occurred.public long getWorldPlaytime(java.lang.String world)
world
- World name being checked.public long getTotal()
public GMTimes getGMTimes(java.lang.String world)
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
world
- World name being checked.public java.util.Map<java.lang.String,GMTimes> getWorldTimes()
public void setGMTimesForWorld(java.lang.String world, GMTimes gmTimes)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Optional<java.lang.String> getCurrentWorld()
public void add(WorldTimes toAdd)
public boolean contains(java.lang.String worldName)