Added Stats.Add

This commit is contained in:
Garry Newman 2017-07-06 10:45:03 +01:00
parent b327ab70f1
commit ea4c6d72b5

View File

@ -91,6 +91,18 @@ namespace Facepunch.Steamworks
return r;
}
/// <summary>
/// Adds this amount to the named stat. Internally this calls Get() and adds
/// to that value. Steam doesn't provide a mechanism for atomically increasing
/// stats like this, this functionality is added here as a convenience.
/// </summary>
public bool Add( string name, int amount = 1, bool store = true )
{
var val = GetInt( name );
val += amount;
return Set( name, val, store );
}
public void Dispose()
{
client = null;