Item

open class Item(component: Component?, inventoryIndex: Int, id: Int, stack: Int, type: ItemType) : GenericItem, Identifiable, Nameable, Stackable, Actionable, Nillable<Item?> , Emittable<ItemAction>

Item

Constructors

Item
Link copied to clipboard
fun Item(component: Component, type: ItemType = ItemType.UNKNOWN)
Item
Link copied to clipboard
fun Item(component: Component?, id: Int, stack: Int, type: ItemType = ItemType.UNKNOWN)
Item
Link copied to clipboard
fun Item(component: Component?, inventoryIndex: Int, id: Int, stack: Int, type: ItemType = ItemType.UNKNOWN)

Types

Companion
Link copied to clipboard
object Companion

Functions

actions
Link copied to clipboard
open override fun actions(): List<String>

The current actions for the entity.

basePoint
Link copied to clipboard
open override fun basePoint(): Point

{@inheritDoc}

boundingModel
Link copied to clipboard
fun boundingModel(): BoundingModel?

Gets the current bounding model

fun boundingModel(boundingModel: BoundingModel?)

Sets the bounding model

fun boundingModel(expectedModel: BoundingModel?, boundingModel: BoundingModel?)

Compares and sets the bounding model

boundingRect
Link copied to clipboard
fun boundingRect(): Rectangle
bounds
Link copied to clipboard
open override fun bounds(arr: IntArray?)

Sets the boundaries of this entity utilizing an array.

open override fun bounds(x1: Int, x2: Int, y1: Int, y2: Int, z1: Int, z2: Int)

Sets the bound of the item from the center. Do note that z1 and z2 are ignored.

calculateScreenPosition
Link copied to clipboard
open override fun calculateScreenPosition(): Callable<Point>
centerPoint
Link copied to clipboard
open override fun centerPoint(): Point

{@inheritDoc}

click
Link copied to clipboard
open override fun click(): Boolean
open override fun click(action: String?): Boolean
open override fun click(action: String?, option: String?): Boolean
open override fun click(f: Filter<MenuCommand>, useMenu: Boolean): Boolean

{@inheritDoc}

open override fun click(f: (MenuCommand) -> Boolean): Boolean
component
Link copied to clipboard
fun component(): Component?
contains
Link copied to clipboard
open operator override fun contains(point: Point?): Boolean

Whether or not the entity contains the point.

cosmetic
Link copied to clipboard
fun cosmetic(): Boolean

Whether or not the item is a cosmetic.

createAction
Link copied to clipboard
open override fun createAction(action: String?): ItemAction
open override fun createAction(action: String?, async: Boolean): ItemAction
doSetBounds
Link copied to clipboard
fun doSetBounds(arr: IntArray?): Filter<Interactable?>
draw
Link copied to clipboard
open override fun draw(g: Graphics)

Renders the entity within the viewport at alpha = 255

groundActions
Link copied to clipboard
fun groundActions(): List<String>

An array of the possible actions if the item were on the ground.

id
Link copied to clipboard
open override fun id(): Int

The identifier of this entity

interact
Link copied to clipboard
open override fun interact(action: String?): Boolean
open override fun interact(f: (MenuCommand) -> Boolean): Boolean
open override fun interact(f: Filter<MenuCommand>): Boolean
open override fun interact(action: String?, hasMenu: Boolean): Boolean
open override fun interact(action: String?, option: String?): Boolean
open override fun interact(f: (MenuCommand) -> Boolean, useMenu: Boolean): Boolean
open override fun interact(f: Filter<MenuCommand>, useMenu: Boolean): Boolean
open override fun interact(action: String?, option: String?, hasMenu: Boolean): Boolean

{@inheritDoc}

inventoryActions
Link copied to clipboard
fun inventoryActions(): List<String>

An array of the possible actions if the item were in the inventory.

inventoryIndex
Link copied to clipboard
fun inventoryIndex(): Int
inViewport
Link copied to clipboard
open override fun inViewport(): Boolean

{@inheritDoc}

open override fun inViewport(checkIfObstructed: Boolean): Boolean

Returns true if the object is currently rendered in the viewport.

members
Link copied to clipboard
fun members(): Boolean

Whether or not the item is a members' item.

modelId
Link copied to clipboard
fun modelId(): Int

The model ID of the item.

name
Link copied to clipboard
open override fun name(): String
nextPoint
Link copied to clipboard
open override fun nextPoint(): Point

The next game screen point of the entity.

nil
Link copied to clipboard
open override fun nil(): Item

A "null" instance. An object with no function. All methods will not evaluate to anything.

noted
Link copied to clipboard
fun noted(): Boolean

Whether or not the item is in banknote form.

price
Link copied to clipboard
fun price(): Int
stackable
Link copied to clipboard
fun stackable(): Boolean

Whether or not the item is stackable.

stackSize
Link copied to clipboard
open override fun stackSize(): Int

The quantity of the item.

tradeable
Link copied to clipboard
fun tradeable(): Boolean

Whether or not the item is tradeable.

triangles
Link copied to clipboard
open override fun triangles(): Array<Polygon>

The translated model triangles.

valid
Link copied to clipboard
open override fun valid(): Boolean
value
Link copied to clipboard
fun value(): Int

The value of the item which would appear in most shops. This may be used to also grab the high/low alchemy value, as well.

Properties

boundingModel
Link copied to clipboard
var boundingModel: AtomicReference<BoundingModel?>
cachedConfig
Link copied to clipboard
val cachedConfig: IItemConfig?
component
Link copied to clipboard
val component: Component?
config
Link copied to clipboard
val config: CacheItemConfig
id
Link copied to clipboard
val id: Int
inventoryIndex
Link copied to clipboard
val inventoryIndex: Int
stack
Link copied to clipboard
var stack: Int
type
Link copied to clipboard
var type: ItemType