Skip to main content

Stat

A class in Root.Township, Alta.Achievements.

One platform achievement stat (such as a Steam stat), as an int or a float. Setting a value passes it on to AchievementManager, which sends it to the platform.

Constructors​

MemberWhat it is
Stat(IStatManager manager, AchievementStatDefinition definition)Creates a Stat from manager and definition.

Fields​

3 private and internal fields
MemberWhat it is
private float floatValueBacking field for FloatValue. Setting the property tells the manager the stat changed.
private int intValueBacking field for IntValue. Setting the property tells the manager the stat changed.
private IStatManager managerStat manager told about every value change.

Properties​

MemberWhat it is
AchievementStatDefinition Definition { get; private set; }The stat's definition asset.
float FloatValue { get; set; }The float value. Setting it tells the manager the stat changed.
int IntValue { get; set; }The int value. Setting it tells the manager the stat changed.
bool IsDefined { get; private set; }True once a value has come back from the platform through ServerUpdate.

Methods​

MemberWhat it is
void RequestUpdate()Asks the platform for the stat's current value.
void ServerUpdate(int value)Sets the value received from the platform and marks the stat as defined.
void ServerUpdate(float value)Sets the value received from the platform and marks the stat as defined.

Used in​

Members of other types that take, return or hold a Stat: