From 6c434df63811ab584c2ab105a11d64f675cc3285 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 31 Jan 2018 12:52:02 +0000 Subject: [PATCH] Added Inventory.DefinitionsWithPrices --- Facepunch.Steamworks/Interfaces/Inventory.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs index c833d27..26acb2c 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.cs @@ -248,6 +248,21 @@ public void Update() /// public Definition[] Definitions; + /// + /// A list of item definitions that have prices and so can be bought. + /// + public IEnumerable DefinitionsWithPrices + { + get + { + for( int i=0; i< Definitions.Length; i++ ) + { + if (Definitions[i].LocalPrice > 0) + yield return Definitions[i]; + } + } + } + /// /// Utility, given a "1;VLV250" string, convert it to a 2.5 ///