mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Added Inventory.Definition.GetCachedStringProperty
This commit is contained in:
parent
879a284de3
commit
26a64f64e7
@ -152,6 +152,25 @@ public string GetStringProperty( string name )
|
|||||||
return val;
|
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>
|
/// <summary>
|
||||||
/// Read a raw property from the definition schema
|
/// Read a raw property from the definition schema
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user