public class MaxIntStat extends IntStat
IntStat by maintaining a maximum value which is updated every time a value
is accumulated to the stat. Thus we track an accumulating value as well as the largest amount by
which it has ever accumulated.Stat.AuxDataSource, Stat.Type| Constructor and Description |
|---|
MaxIntStat() |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxValue()
Returns the maximum value every accumulated to this integer statistic.
|
boolean |
increment(int delta)
Increments this statistic by the specified delta value.
|
void |
persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database.
|
void |
unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
Unserializes this item from data obtained from the item database.
|
String |
valueToString()
Derived statistics must override this method and render their value to a string.
|
clone, crc32, getCode, getKey, getModCount, getType, getType, initType, isModified, setModCount, setModified, toStringpublic int getMaxValue()
public boolean increment(int delta)
IntStatpublic String valueToString()
StatStat.toString() and to display the value in game.valueToString in class IntStatpublic void persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
StatpersistTo in class IntStatIOExceptionpublic void unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
StatunpersistFrom in class IntStatIOExceptionClassNotFoundExceptionCopyright © 2015. All rights reserved.