mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 14:48:02 +03:00
Item stacking, unstacking
This commit is contained in:
parent
0f26139d38
commit
88e2568e9f
@ -223,5 +223,29 @@ namespace Facepunch.Steamworks
|
||||
|
||||
return new Result( this, resultHandle );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Split stack into two items
|
||||
/// </summary>
|
||||
public Result SplitStack( Item item, int quantity = 1 )
|
||||
{
|
||||
SteamNative.SteamInventoryResult_t resultHandle = -1;
|
||||
if ( !inventory.TransferItemQuantity( ref resultHandle, item.Id, (uint)quantity, ulong.MaxValue ) )
|
||||
return null;
|
||||
|
||||
return new Result( this, resultHandle );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stack source item onto dest item
|
||||
/// </summary>
|
||||
public Result Stack( Item source, Item dest, int quantity = 1 )
|
||||
{
|
||||
SteamNative.SteamInventoryResult_t resultHandle = -1;
|
||||
if ( !inventory.TransferItemQuantity( ref resultHandle, source.Id, (uint)quantity, dest.Id ) )
|
||||
return null;
|
||||
|
||||
return new Result( this, resultHandle );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user