SteamInventory

Swift
public struct SteamInventory: Sendable

Steamworks ISteamInventory

Access via inventory through a SteamAPI or SteamGameServerAPI instance.


Topics

func addPromoItem(def: SteamItemDef) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::AddPromoItem()

Declaration
Swift
public func addPromoItem(def: SteamItemDef) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func addPromoItems(arrayItemDefs: [SteamItemDef]) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::AddPromoItems()

Declaration
Swift
public func addPromoItems(arrayItemDefs: [SteamItemDef]) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func checkResultSteamID(handle: SteamInventoryResult, expected: SteamID) -> Bool

Steamworks ISteamInventory::CheckResultSteamID()

Declaration
Swift
public func checkResultSteamID(handle: SteamInventoryResult, expected: SteamID)
    -> Bool

func consumeItem(consume: SteamItemInstanceID, quantity: Int) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::ConsumeItem()

Declaration
Swift
public func consumeItem(consume: SteamItemInstanceID, quantity: Int) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func deserializeResult(buffer: [UInt8], reservedMUSTBEFALSE: Bool) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::DeserializeResult()

Declaration
Swift
public func deserializeResult(
    buffer: [UInt8], reservedMUSTBEFALSE: Bool = false
) -> (rc: Bool, resultHandle: SteamInventoryResult)

func destroyResult(handle: SteamInventoryResult)

Steamworks ISteamInventory::DestroyResult()

Declaration
Swift
public func destroyResult(handle: SteamInventoryResult)

func exchangeItems(arrayGenerate: [SteamItemDef], arrayGenerateQuantity: [Int], arrayDestroy: [SteamItemInstanceID], arrayDestroyQuantity: [Int]) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::ExchangeItems()

Declaration
Swift
public func exchangeItems(
    arrayGenerate: [SteamItemDef], arrayGenerateQuantity: [Int],
    arrayDestroy: [SteamItemInstanceID], arrayDestroyQuantity: [Int]
) -> (rc: Bool, resultHandle: SteamInventoryResult)

func generateItems(arrayItemDefs: [SteamItemDef], arrayQuantity: [Int]) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::GenerateItems()

Declaration
Swift
public func generateItems(arrayItemDefs: [SteamItemDef], arrayQuantity: [Int])
    -> (rc: Bool, resultHandle: SteamInventoryResult)

func getAllItems() -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::GetAllItems()

Declaration
Swift
public func getAllItems() -> (rc: Bool, resultHandle: SteamInventoryResult)

func getEligiblePromoItemDefinitionIDs(steamID: SteamID, itemDefIDsArraySize: Int) -> (rc: Bool, itemDefIDs: [SteamItemDef], itemDefIDsArraySize: Int)

Steamworks ISteamInventory::GetEligiblePromoItemDefinitionIDs()

Declaration
Swift
public func getEligiblePromoItemDefinitionIDs(
    steamID: SteamID, itemDefIDsArraySize: Int
) -> (rc: Bool, itemDefIDs: [SteamItemDef], itemDefIDsArraySize: Int)

func getItemDefinitionIDs(returnItemDefIDs: Bool, itemDefIDsArraySize: Int) -> (rc: Bool, itemDefIDs: [SteamItemDef], itemDefIDsArraySize: Int)

Steamworks ISteamInventory::GetItemDefinitionIDs()

Declaration
Swift
public func getItemDefinitionIDs(
    returnItemDefIDs: Bool = true, itemDefIDsArraySize: Int
) -> (rc: Bool, itemDefIDs: [SteamItemDef], itemDefIDsArraySize: Int)

func getItemDefinitionProperty(definitionIndex: SteamItemDef, propertyName: String?, returnValueBuffer: Bool, valueBufferSize: Int) -> (rc: Bool, valueBuffer: String, valueBufferSize: Int)

Steamworks ISteamInventory::GetItemDefinitionProperty()

Declaration
Swift
public func getItemDefinitionProperty(
    definitionIndex: SteamItemDef, propertyName: String?,
    returnValueBuffer: Bool = true, valueBufferSize: Int
) -> (rc: Bool, valueBuffer: String, valueBufferSize: Int)

func getItemPrice(definitionIndex: SteamItemDef) -> (rc: Bool, currentPrice: UInt64, basePrice: UInt64)

Steamworks ISteamInventory::GetItemPrice()

Declaration
Swift
public func getItemPrice(definitionIndex: SteamItemDef) -> (
    rc: Bool, currentPrice: UInt64, basePrice: UInt64
)

func getItemsByID(instanceIDs: [SteamItemInstanceID]) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::GetItemsByID()

Declaration
Swift
public func getItemsByID(instanceIDs: [SteamItemInstanceID]) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func getItemsWithPrices(arrayLength: Int) -> (rc: Bool, arrayItemDefs: [SteamItemDef], currentPrices: [UInt64], basePrices: [UInt64])

Steamworks ISteamInventory::GetItemsWithPrices()

Declaration
Swift
public func getItemsWithPrices(arrayLength: Int) -> (
    rc: Bool, arrayItemDefs: [SteamItemDef], currentPrices: [UInt64],
    basePrices: [UInt64]
)

func getNumItemsWithPrices() -> Int

Steamworks ISteamInventory::GetNumItemsWithPrices()

Declaration
Swift
public func getNumItemsWithPrices() -> Int

func getResultItemProperty(handle: SteamInventoryResult, itemIndex: Int, propertyName: String?, returnValueBuffer: Bool, valueBufferSize: Int) -> (rc: Bool, valueBuffer: String, valueBufferSize: Int)

Steamworks ISteamInventory::GetResultItemProperty()

Declaration
Swift
public func getResultItemProperty(
    handle: SteamInventoryResult, itemIndex: Int, propertyName: String?,
    returnValueBuffer: Bool = true, valueBufferSize: Int
) -> (rc: Bool, valueBuffer: String, valueBufferSize: Int)

func getResultItems(handle: SteamInventoryResult, returnItemsArray: Bool, itemsArraySize: Int) -> (rc: Bool, itemsArray: [SteamItemDetails], itemsArraySize: Int)

Steamworks ISteamInventory::GetResultItems()

Declaration
Swift
public func getResultItems(
    handle: SteamInventoryResult, returnItemsArray: Bool = true,
    itemsArraySize: Int
) -> (rc: Bool, itemsArray: [SteamItemDetails], itemsArraySize: Int)

func getResultStatus(handle: SteamInventoryResult) -> Result

Steamworks ISteamInventory::GetResultStatus()

Declaration
Swift
public func getResultStatus(handle: SteamInventoryResult) -> Result

func getResultTimestamp(handle: SteamInventoryResult) -> RTime32

Steamworks ISteamInventory::GetResultTimestamp()

Declaration
Swift
public func getResultTimestamp(handle: SteamInventoryResult) -> RTime32

func grantPromoItems() -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::GrantPromoItems()

Declaration
Swift
public func grantPromoItems() -> (rc: Bool, resultHandle: SteamInventoryResult)

func inspectItem(itemToken: String) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::InspectItem()

Declaration
Swift
public func inspectItem(itemToken: String) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func loadItemDefinitions() -> Bool

Steamworks ISteamInventory::LoadItemDefinitions()

Declaration
Swift
@discardableResult
public func loadItemDefinitions() -> Bool

func removeProperty(handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID, propertyName: String) -> Bool

Steamworks ISteamInventory::RemoveProperty()

Declaration
Swift
public func removeProperty(
    handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID,
    propertyName: String
) -> Bool

func requestEligiblePromoItemDefinitionsIDs(steamID: SteamID, completion: (SteamInventoryEligiblePromoItemDefIDs?) -> Void)

Steamworks ISteamInventory::RequestEligiblePromoItemDefinitionsIDs(), callback

Declaration
Swift
public func requestEligiblePromoItemDefinitionsIDs(
    steamID: SteamID,
    completion: @escaping (SteamInventoryEligiblePromoItemDefIDs?) -> Void)

func requestEligiblePromoItemDefinitionsIDs(steamID: SteamID) async -> SteamInventoryEligiblePromoItemDefIDs?

Steamworks ISteamInventory::RequestEligiblePromoItemDefinitionsIDs(), async

Declaration
Swift
public func requestEligiblePromoItemDefinitionsIDs(steamID: SteamID) async
    -> SteamInventoryEligiblePromoItemDefIDs?

func requestPrices(completion: (SteamInventoryRequestPricesResult?) -> Void)

Steamworks ISteamInventory::RequestPrices(), callback

Declaration
Swift
public func requestPrices(
    completion: @escaping (SteamInventoryRequestPricesResult?) -> Void)

func requestPrices() async -> SteamInventoryRequestPricesResult?

Steamworks ISteamInventory::RequestPrices(), async

Declaration
Swift
public func requestPrices() async -> SteamInventoryRequestPricesResult?

func sendItemDropHeartbeat()

Steamworks ISteamInventory::SendItemDropHeartbeat()

Declaration
Swift
public func sendItemDropHeartbeat()

func serializeResult(handle: SteamInventoryResult, returnBuffer: Bool, bufferSize: Int) -> (rc: Bool, buffer: [UInt8], bufferSize: Int)

Steamworks ISteamInventory::SerializeResult()

Declaration
Swift
public func serializeResult(
    handle: SteamInventoryResult, returnBuffer: Bool = true, bufferSize: Int
) -> (rc: Bool, buffer: [UInt8], bufferSize: Int)

func setProperty(handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID, propertyName: String, value: Bool) -> Bool

Steamworks ISteamInventory::SetProperty()

Declaration
Swift
public func setProperty(
    handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID,
    propertyName: String, value: Bool
) -> Bool

func setProperty(handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID, propertyName: String, value: Float) -> Bool

Steamworks ISteamInventory::SetProperty()

Declaration
Swift
public func setProperty(
    handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID,
    propertyName: String, value: Float
) -> Bool

func setProperty(handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID, propertyName: String, value: Int) -> Bool

Steamworks ISteamInventory::SetProperty()

Declaration
Swift
public func setProperty(
    handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID,
    propertyName: String, value: Int
) -> Bool

func setProperty(handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID, propertyName: String, propertyValue: String) -> Bool

Steamworks ISteamInventory::SetProperty()

Declaration
Swift
public func setProperty(
    handle: SteamInventoryUpdateHandle, itemID: SteamItemInstanceID,
    propertyName: String, propertyValue: String
) -> Bool

func startPurchase(arrayItemDefs: [SteamItemDef], arrayQuantity: [Int], completion: (SteamInventoryStartPurchaseResult?) -> Void)

Steamworks ISteamInventory::StartPurchase(), callback

Declaration
Swift
public func startPurchase(
    arrayItemDefs: [SteamItemDef], arrayQuantity: [Int],
    completion: @escaping (SteamInventoryStartPurchaseResult?) -> Void)

func startPurchase(arrayItemDefs: [SteamItemDef], arrayQuantity: [Int]) async -> SteamInventoryStartPurchaseResult?

Steamworks ISteamInventory::StartPurchase(), async

Declaration
Swift
public func startPurchase(arrayItemDefs: [SteamItemDef], arrayQuantity: [Int])
    async -> SteamInventoryStartPurchaseResult?

func startUpdateProperties() -> SteamInventoryUpdateHandle

Steamworks ISteamInventory::StartUpdateProperties()

Declaration
Swift
public func startUpdateProperties() -> SteamInventoryUpdateHandle

func submitUpdateProperties(handle: SteamInventoryUpdateHandle) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::SubmitUpdateProperties()

Declaration
Swift
public func submitUpdateProperties(handle: SteamInventoryUpdateHandle) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func transferItemQuantity(idSource: SteamItemInstanceID, quantity: Int, idDest: SteamItemInstanceID) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::TransferItemQuantity()

Declaration
Swift
public func transferItemQuantity(
    idSource: SteamItemInstanceID, quantity: Int, idDest: SteamItemInstanceID
) -> (rc: Bool, resultHandle: SteamInventoryResult)

func triggerItemDrop(listDefinition: SteamItemDef) -> (rc: Bool, resultHandle: SteamInventoryResult)

Steamworks ISteamInventory::TriggerItemDrop()

Declaration
Swift
public func triggerItemDrop(listDefinition: SteamItemDef) -> (
    rc: Bool, resultHandle: SteamInventoryResult
)

func getItemDefinitionIDs() -> (rc: Bool, itemDefIDs: [SteamItemDef])

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::GetItemDefinitionIDs()

Declaration
Swift
public func getItemDefinitionIDs() -> (rc: Bool, itemDefIDs: [SteamItemDef])

func getItemDefinitionProperty(definitionIndex: SteamItemDef, propertyName: String?) -> (rc: Bool, valueBuffer: String)

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::GetItemDefinitionProperty()

Declaration
Swift
public func getItemDefinitionProperty(
    definitionIndex: SteamItemDef, propertyName: String?
) -> (rc: Bool, valueBuffer: String)

func getItemsWithPrices() -> (rc: Bool, arrayItemDefs: [SteamItemDef], currentPrices: [UInt64], basePrices: [UInt64])

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::GetItemsWithPrices()

Declaration
Swift
public func getItemsWithPrices() -> (
    rc: Bool, arrayItemDefs: [SteamItemDef], currentPrices: [UInt64],
    basePrices: [UInt64]
)

func getResultItems(handle: SteamInventoryResult) -> (rc: Bool, itemsArray: [SteamItemDetails])

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::GetResultItems()

Declaration
Swift
public func getResultItems(handle: SteamInventoryResult) -> (
    rc: Bool, itemsArray: [SteamItemDetails]
)

func getResultItemProperty(handle: SteamInventoryResult, itemIndex: Int, propertyName: String?) -> (rc: Bool, valueBuffer: String)

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::GetResultItemProperty()

Declaration
Swift
public func getResultItemProperty(
    handle: SteamInventoryResult, itemIndex: Int, propertyName: String?
) -> (rc: Bool, valueBuffer: String)

func serializeResult(handle: SteamInventoryResult) -> (rc: Bool, buffer: [UInt8])

Note

Provided by module SteamworksHelpers.

Steamworks ISteamInventory::SerializeResult()

Declaration
Swift
public func serializeResult(handle: SteamInventoryResult) -> (
    rc: Bool, buffer: [UInt8]
)