Inventory

object Inventory

Inventory

Functions

boundingRect
Link copied to clipboard
fun boundingRect(index: Int): Rectangle

Finds the boundingRectangle of the desired index, not every area within the rectangle will click the item

component
Link copied to clipboard
fun component(): Component
drag
Link copied to clipboard
fun drag(item: Item, index: Int): Boolean

Drags the given item to the given index

drop
Link copied to clipboard
fun drop(items: List<Item?>): Boolean

Drops specified items, uses shift dropping if enabled

fun drop(i: Item, shift: Boolean): Boolean

Drops specified item via regular or shift dropping.

emptySlotCount
Link copied to clipboard
fun emptySlotCount(): Int
enableShiftDropping
Link copied to clipboard
fun enableShiftDropping(): Boolean
get
Link copied to clipboard
fun get(predicate: Predicate<Item>? = null): List<Item>

{@inheritDoc}

indexCenterPoint
Link copied to clipboard
fun indexCenterPoint(index: Int): Point

Finds the center point of the inventory's index

fun indexCenterPoint(row: Int, column: Int): Point

Gives center for a position (row, column). Example, item at index 0 is referenced by (0,0) or 6 by (1,2).

indexPosition
Link copied to clipboard
fun indexPosition(index: Int): Point

Converts an index to it's positional representation. Example, item at index 0 is returned as (0,0) or 6 as (1,2). This exists only for people who want a single atomic call to get inventory column and row. Doesn't throw an excception if out of bound.

inventoryColumn
Link copied to clipboard
fun inventoryColumn(index: Int): Int

Gives the row of a given index. Does not throw an exception if index is out of range.

inventoryIndex
Link copied to clipboard
fun inventoryIndex(row: Int, column: Int): Int

Gives the index for a given row and column. Does not throw an exception if row/column are out of range.

inventoryRow
Link copied to clipboard
fun inventoryRow(index: Int): Int

Gives the row of a given index. Does not throw an exception if index is out of range.

isEmpty
Link copied to clipboard
fun isEmpty(): Boolean
isFull
Link copied to clipboard
fun isFull(): Boolean
isNotEmpty
Link copied to clipboard
fun isNotEmpty(): Boolean
itemAt
Link copied to clipboard
fun itemAt(index: Int): Item

Gives you the item at a certain index.

fun itemAt(row: Int, column: Int): Item

Gives you an item at a certain position.

items
Link copied to clipboard
fun items(): Array<Item>
nil
Link copied to clipboard
fun nil(): Item
occupiedSlotCount
Link copied to clipboard
fun occupiedSlotCount(): Int
open
Link copied to clipboard
fun open(): Boolean
opened
Link copied to clipboard
fun opened(): Boolean
selectedItem
Link copied to clipboard
fun selectedItem(): Item
selectedItemIndex
Link copied to clipboard
fun selectedItemIndex(): Int
selectionType
Link copied to clipboard
fun selectionType(): Int
shiftDroppingEnabled
Link copied to clipboard
fun shiftDroppingEnabled(): Boolean
stream
Link copied to clipboard
fun stream(): InventoryItemStream

{@inheritDoc}