diff --git a/Facepunch.Steamworks/Client/Stats.cs b/Facepunch.Steamworks/Client/Stats.cs index 066918d..5b8eac3 100644 --- a/Facepunch.Steamworks/Client/Stats.cs +++ b/Facepunch.Steamworks/Client/Stats.cs @@ -91,6 +91,18 @@ namespace Facepunch.Steamworks return r; } + /// + /// 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. + /// + 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;