public                          InventoryItem[] GetItems(bool includeProperties = false)
        {
            uint cnt = (uint)ItemCount;

            if (cnt <= 0)
            {
                return(null);
            }

            var pOutItemsArray = new SteamItemDetails_t[cnt];

            if (!SteamInventory.Internal.GetResultItems(_id, pOutItemsArray, ref cnt))
            {
                return(null);
            }

            var items = new InventoryItem[cnt];

            for (int i = 0; i < cnt; i++)
            {
                var item = InventoryItem.From(pOutItemsArray[i]);

                if (includeProperties)
                {
                    item._properties = InventoryItem.GetProperties(_id, i);
                }

                items[i] = item;
            }


            return(items);
        }
Example #2
0
        public                          InventoryItem[] GetItems(bool includeProperties = false)
        {
            InventoryItem[] inventoryItemArray;
            uint            itemCount = (uint)this.ItemCount;

            if (itemCount != 0)
            {
                SteamItemDetails_t[] steamItemDetailsTArray = new SteamItemDetails_t[itemCount];
                if (SteamInventory.Internal.GetResultItems(this._id, steamItemDetailsTArray, ref itemCount))
                {
                    InventoryItem[] inventoryItemArray1 = new InventoryItem[itemCount];
                    for (int i = 0; (long)i < (ulong)itemCount; i++)
                    {
                        InventoryItem properties = InventoryItem.From(steamItemDetailsTArray[i]);
                        if (includeProperties)
                        {
                            properties._properties = InventoryItem.GetProperties(this._id, i);
                        }
                        inventoryItemArray1[i] = properties;
                    }
                    inventoryItemArray = inventoryItemArray1;
                }
                else
                {
                    inventoryItemArray = null;
                }
            }
            else
            {
                inventoryItemArray = null;
            }
            return(inventoryItemArray);
        }
Example #3
0
        internal static InventoryItem From(SteamItemDetails_t details)
        {
            var i = new InventoryItem
            {
                _id       = details.ItemId,
                _def      = details.Definition,
                _flags    = details.Flags,
                _quantity = details.Quantity
            };

            return(i);
        }
		/// <summary>
		/// <para> Copies the contents of a result set into a flat array. The specific</para>
		/// <para> contents of the result set depend on which query which was used.</para>
		/// </summary>
		public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerInventory_GetResultItems(resultHandle, pOutItemsArray, ref punOutItemsArraySize);
		}