Class GGInventoryStackingStrategy extends Resource

Implements the interface for stacking and splitting of inventory items.

The stack_items() method stacks as many items as possible to "unclutter" the inventory. The split_item() method can be used to split an item into two. In addition, the provided can_stack() and stack() methods.

The methods in this class are not intended to be called directly. They are called by a [GGInventory] instance.

Note: This class does not provide an implementation. Please use [GGInventoryStackingStrategyDefault] instead.

# Methods

## Returns whether the [param source_item] from the [param source_inventory] can be stacked onto the [param target_item] in the [param target_inventory].
func can_stack(source_inventory: GGInventorytarget_inventory: GGInventorysource_item: GGItemDatatarget_item: GGItemData) -> bool
## Attempt to stack source onto target. returns the quantity that was stacked (0 means nothing was stacked).
func stack(source_inventory: GGInventorytarget_inventory: GGInventorysource_item: GGItemDatatarget_slot_id: intquantity: int) -> int
## Combine all compatible stackable items in the inventory, so they take up the least amount of slots possible.
func stack_items(inventory: GGInventory) -> void
## Splits an item into two. If no [param quantity] is specified, it will split the [param item] as evenly in half as possible.
func split_item(inventory: GGInventoryitem: GGItemDataquantity: int) -> void