diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs index b7249bb..a49e62e 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs @@ -152,6 +152,25 @@ public string GetStringProperty( string name ) return val; } + /// + /// Read and cache a raw property from the definition schema to make accessing it faster in the future + /// + public string GetCachedStringProperty( string name ) + { + string val = string.Empty; + + if ( customProperties == null ) + customProperties = new Dictionary(); + + if ( !customProperties.TryGetValue( name, out val ) ) + { + inventory.inventory.GetItemDefinitionProperty( Id, name, out val ); + customProperties.Add( name, val ); + } + + return val; + } + /// /// Read a raw property from the definition schema ///