com.threerings.stats.data
Class MaxValueIntStat
java.lang.Object
com.threerings.stats.data.Stat
com.threerings.stats.data.IntStat
com.threerings.stats.data.MaxValueIntStat
- All Implemented Interfaces:
- Streamable, DSet.Entry, Cloneable
public class MaxValueIntStat
- extends IntStat
Extends the IntStat by maintaining the maximum value that the stat has ever been
assigned (unlike MaxIntStat, which tracks the maximum value that the stat has ever
been incremented by).
|
Field Summary |
protected int |
_maxValue
The largest value that this stat has been assigned. |
| Fields inherited from class com.threerings.stats.data.IntStat |
_value |
| Methods inherited from class com.threerings.stats.data.Stat |
clone, crc32, getCode, getKey, getModCount, getType, getType, initType, isModified, setModCount, setModified, toString |
_maxValue
protected int _maxValue
- The largest value that this stat has been assigned.
MaxValueIntStat
public MaxValueIntStat()
getMaxValue
public int getMaxValue()
- Returns the maximum value that this integer statistic has ever been assigned.
setValue
public boolean setValue(int value)
- Description copied from class:
IntStat
- Sets this statistic's value to the specified value.
- Overrides:
setValue in class IntStat
- Returns:
- true if the stat was modified, false if not.
valueToString
public String valueToString()
- Description copied from class:
Stat
- Derived statistics must override this method and render their value to a string. Used by
Stat.toString() and to display the value in game.
- Overrides:
valueToString in class IntStat
persistTo
public void persistTo(ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
- Description copied from class:
Stat
- Serializes this instance for storage in the item database. Derived classes must override
this method to implement persistence.
- Overrides:
persistTo in class IntStat
- Throws:
IOException
unpersistFrom
public void unpersistFrom(ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
- Description copied from class:
Stat
- Unserializes this item from data obtained from the item database. Derived classes must
override this method to implement persistence.
- Overrides:
unpersistFrom in class IntStat
- Throws:
IOException
ClassNotFoundException