Add IGameInventory.GetInventoryItems (#2008)

This commit is contained in:
Haselnussbomber 2024-11-04 16:28:06 +01:00 committed by GitHub
parent 620a802755
commit 2a9ee760c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -403,6 +403,9 @@ internal class GameInventoryPluginScoped : IInternalDisposableService, IGameInve
/// <inheritdoc/>
public event IGameInventory.InventoryChangedDelegate<InventoryItemMergedArgs>? ItemMergedExplicit;
/// <inheritdoc/>
public ReadOnlySpan<GameInventoryItem> GetInventoryItems(GameInventoryType type) => GameInventoryItem.GetReadOnlySpanOfInventory(type);
/// <inheritdoc/>
void IInternalDisposableService.DisposeService()
{

View file

@ -103,4 +103,11 @@ public interface IGameInventory
/// <inheritdoc cref="ItemMerged"/>
public event InventoryChangedDelegate<InventoryItemMergedArgs> ItemMergedExplicit;
/// <summary>
/// Gets all item slots of the specified inventory type.
/// </summary>
/// <param name="type">The type of inventory to get the items for.</param>
/// <returns>A read-only span of all items in the specified inventory type.</returns>
public ReadOnlySpan<GameInventoryItem> GetInventoryItems(GameInventoryType type);
}