AbstractContentContainer

abstract class AbstractContentContainer(val rowLength: Int, val size: Int) : InventoryContentContainer

Basic representation of a content container with simple item managements

Author

Devin

Since

1.0.0

See also

Inheritors

Constructors

Link copied to clipboard
constructor(rowLength: Int, size: Int)

Properties

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

Content of the container

Link copied to clipboard

the length of a row in the inventory

Link copied to clipboard
val size: Int

of the content container, should be a multiple of the rowLength

Functions

Link copied to clipboard
open override fun clearInventory()

Clears the inventory from all items inside it

Link copied to clipboard
open override 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
open override fun setItem(slot: Int, value: KItem)

Sets the given item at the given position

open override fun setItem(row: Int, slot: Int, item: KItem)

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

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

Sets the given row at the given index

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

Swaps two rows in an inventory

open override fun swapRow(index: Int, otherIndex: Int)

Swaps two rows based on their index