
#include "sbox/steam/steaminventory.h"

native class CSteamItemInstance
{
	ulong ItemId();
	uint DefinitionId();
}

native class CSteamInventoryResult
{
	void Destroy(); [delete]

	bool IsPending();
	bool IsOk();

	bool CheckSteamId( ulong steamid );
	uint GetTimestamp();

	int Count();

	CSteamItemInstance Get( int index );
}

native static class Steam.Inventory as NativeEngine.SteamInventory
{
	// getting an inventory contents
	CSteamInventoryResult GetAllItems();

	// getting a list of inventories
	int DefinitionCount();
	int GetDefinitionId( int index );

	string GetDefinitionProperty( int definitionId, string propertyName );
	bool GetDefinitionPrice( int index, out ulong price, out ulong baseprice );

	bool HasPrices();
	string GetCurrency();

	void CheckOut( int[] defs, int count );
	bool IsCheckingOut();
	bool WasCheckoutSuccessful();
}

managed static class Sandbox.Services.Inventory
{
	static void OnDefinitionUpdate();
	static void OnPricesUpdate( bool success, string currency );
	static void OnPurchaseResult( bool success, ulong orderid, ulong transid );
}