public abstract class Stat extends Object implements com.threerings.presents.dobj.DSet.Entry, Cloneable
| Modifier and Type | Class and Description |
|---|---|
static interface |
Stat.AuxDataSource
Provides auxilliary information to statistics during the persisting process.
|
static interface |
Stat.Type
Defines the various per-player tracked statistics.
|
| Constructor and Description |
|---|
Stat() |
| Modifier and Type | Method and Description |
|---|---|
Stat |
clone() |
static int |
crc32(String string)
Computes and returns the CRC32 hash of the specified string.
|
int |
getCode()
Returns the integer code to which this statistic's name maps.
|
String |
getKey() |
byte |
getModCount()
Returns the modification count of this Stat when it was loaded from the repository.
|
Stat.Type |
getType()
Returns the type of this statistic.
|
static Stat.Type |
getType(int code)
|
static int |
initType(Stat.Type type,
Stat prototype)
Used by the
Stat.Type implementation to map itself to an integer code. |
boolean |
isModified()
Returns true if the supplied statistic has been modified since it
was loaded from the repository.
|
abstract void |
persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database.
|
void |
setModCount(byte modCount)
Sets the modification count for this Stat.
|
void |
setModified(boolean modified)
Forces this stat to consider itself modified.
|
String |
toString() |
abstract void |
unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
Unserializes this item from data obtained from the item database.
|
abstract String |
valueToString()
Derived statistics must override this method and render their value to a string.
|
public static Stat.Type getType(int code)
public static int initType(Stat.Type type, Stat prototype)
Stat.Type implementation to map itself to an integer code.public static int crc32(String string)
public Stat.Type getType()
public int getCode()
public boolean isModified()
public void setModified(boolean modified)
public byte getModCount()
public void setModCount(byte modCount)
public abstract void persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
IOExceptionpublic abstract void unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic abstract String valueToString()
toString() and to display the value in game.public String getKey()
getKey in interface com.threerings.presents.dobj.DSet.EntryCopyright © 2015. All rights reserved.