mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-11-13 22:34:53 +03:00
Added Inventory.Definition.GetCachedStringProperty
This commit is contained in:
parent
879a284de3
commit
26a64f64e7
1 changed files with 19 additions and 0 deletions
|
|
@ -152,6 +152,25 @@ namespace Facepunch.Steamworks
|
|||
return val;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read and cache a raw property from the definition schema to make accessing it faster in the future
|
||||
/// </summary>
|
||||
public string GetCachedStringProperty( string name )
|
||||
{
|
||||
string val = string.Empty;
|
||||
|
||||
if ( customProperties == null )
|
||||
customProperties = new Dictionary<string, string>();
|
||||
|
||||
if ( !customProperties.TryGetValue( name, out val ) )
|
||||
{
|
||||
inventory.inventory.GetItemDefinitionProperty( Id, name, out val );
|
||||
customProperties.Add( name, val );
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a raw property from the definition schema
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue