KRowImpl

class KRowImpl(val name: String = "") : KRow

Constructors

Link copied to clipboard
constructor(name: String = "")

Properties

Link copied to clipboard
open override var index: Int

Index of the row inside the parent container

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

The items contained in the KRow Maps the Slot to the KItem inside the row

Link copied to clipboard
open override val name: String

Name of the row

Link copied to clipboard
open override var parent: InventoryContentContainer?

The parent container of this row. This should always be set by the parent inventory or page, and will be set automatically when using the builders!

Functions

Link copied to clipboard
open override fun clicked(player: Player, kItem: KItem)

Executed the onClicked event listeners for this row

Link copied to clipboard
open override fun onClick(action: InventoryContentContainer.(player: Player, row: KRowImpl, kItem: KItem) -> Unit)

Executed when any item inside the row is clicked

Link copied to clipboard
open override fun setItem(slot: Int, item: KItem)

Sets the given item in the given slot. When changing an item in a slot, the inventory will update accordingly

open override fun setItem(range: IntRange, item: KItem)

Sets the given item in the given range. When changing an item in a slot, the inventory will update accordingly

Link copied to clipboard
open override fun shift(direction: ShiftDirection, amount: Int, wrap: Boolean)

Shifts the items inside the row to the given direction. Because items can also be set at a negative slot or slot larger than 9, the items next to it will come. If wrap is enabled, it will wrap the last items back to the beginning.