mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-24 04:28:00 +03:00
Added Stats.Add
This commit is contained in:
parent
b327ab70f1
commit
ea4c6d72b5
@ -91,6 +91,18 @@ namespace Facepunch.Steamworks
|
|||||||
return r;
|
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()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
client = null;
|
client = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user