InventoryContentContainer

Models a content container for inventory items

Author

Devin

Since

1.0.0

Inheritors

Properties

Link copied to clipboard
abstract val content: MutableMap<Int, KItem>

Content of the container

Functions

Link copied to clipboard
abstract fun clearInventory()

Clears the inventory from all items inside it

Link copied to clipboard
abstract fun getRowFor(index: Int): KRow

Gets the row for the given index This will create a new row for the returned value

Link copied to clipboard
abstract fun setItem(slot: Int, value: KItem)

Sets the given item at the given position

abstract fun setItem(row: Int, slot: Int, item: KItem)

Sets the given item relative to the slot of the given row

Link copied to clipboard
abstract fun setRow(index: Int, row: KRow)

Sets the given row at the given index

Link copied to clipboard
abstract fun swapRow(row: KRow, otherRow: KRow)

Swaps two rows in an inventory

abstract fun swapRow(index: Int, otherIndex: Int)

Swaps two rows based on their index