Page cover image

Float Stat

Like what your seeing?

Introduction

public class FloatStatObject : StatObject

Represents a float stat, consult the Steam Documentation for the specific use cases for each of the stat types

Fields and Attributes

Value

public float Value { get; set; }

Reads or writes the value of this stat.

Methods

Store Stats

public void StoreStats();

Calls Store Stats on the the Steam API

Request User Stats

public void RequestUserStats(UserData user, 
                             Action<UserStatsReceived_t, bool> callback)

Requests the stats of a specific user be downloaded from Valve's servers. The callback on this indicates when the request is completed along with its status ... the handler would look similar to the following

void HandleCallback(UserStatsRecieved_t results, bool IOError)
{
    if(!IOError 
        && results.m_eResult == EResult.k_EResultOK)
    {
        //We now have the stats for this user
    }
}

Get Value

For use after you have called RequestUserStats, this gets the value for a specific user and has two overloads one for int values and one for float values.

public bool GetValue(UserData user, out int value)

or

public bool GetValue(UserData user, out float value)

If the method returns false the stat was not found, if it returns true then the value will be populated with the result.

Last updated