ItemPacker

After discovery phase (find all items, group them by their type, sort them by usefulness), this class tries to fit the given requirements (max blocks, required stack cound, etc.) and packs the given items in their target slots.

Items that were deemed useful can be found in usefulItems.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Properties

Link copied to clipboard

If an item is used by a move, it will be in this list.

Functions

Link copied to clipboard
fun packItems(itemsToFillIn: List<ItemFacet>, hotbarSlotsToFill: List<ItemSlot>?, forbiddenSlots: Set<ItemSlot>, forbiddenSlotsToFill: Set<ItemSlot>, constraintProvider: ItemPacker.ItemAmountConstraintProvider): List<InventorySwap>

Takes items from the itemsToFillIn list until it has collected maxItemCount items and requiredStackCount stacks. The items are marked as useful and fill in hotbar slots if there are still slots to fill.