Package org.rspeer.game.component
Class Item
java.lang.Object
org.rspeer.game.component.Item
- All Implemented Interfaces:
Actionable
,Defined<RSItemDefinition,
,ItemDefinition> Identifiable
,Interactable
,Nameable
public class Item
extends Object
implements Identifiable, Nameable, Interactable, Defined<RSItemDefinition,ItemDefinition>
Represents an
Item
in game-
Nested Class Summary
Nested classes/interfaces inherited from interface org.rspeer.game.adapter.type.Actionable
Actionable.Query<Q extends Actionable.Query<Q>>
Nested classes/interfaces inherited from interface org.rspeer.game.adapter.type.Identifiable
Identifiable.Query<Q extends Identifiable.Query<Q>>
Nested classes/interfaces inherited from interface org.rspeer.game.adapter.type.Nameable
Nameable.Query<Q extends Nameable.Query<Q>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Item
combine
(RSInventory inv, InterfaceComponent component, int index) static Item
direct
(boolean forceComponent, RSInventory inv, InterfaceComponent component) static Item
direct
(RSInventory inv, InterfaceComponent component) boolean
static Item
from
(InterfaceComponent component) int
getId()
int
getIndex()
getName()
String[]
getSprite
(int border, int shadow, int stackable, boolean noted) int
static Item
getTableElement
(InterfaceComponent component, int index) int
hashCode()
boolean
isNoted()
static boolean
isNullId
(int id) boolean
boolean
boolean
static Item
parent
(RSInventory inv, InterfaceComponent component) void
setActionOverride
(BiFunction<Item, String, MenuAction> actionOverride) void
setActionSupplier
(Function<Item, List<String>> actionSupplier) toString()
static Item
unbound
(int index, int id, int stackSize) Methods inherited from interface org.rspeer.game.adapter.type.Actionable
containsAction, containsAction
-
Constructor Details
-
Item
-
-
Method Details
-
unbound
-
combine
-
parent
-
from
-
direct
-
direct
-
getTableElement
-
isNullId
public static boolean isNullId(int id) -
getComponent
-
isUnbound
public boolean isUnbound() -
getName
-
getId
public int getId()- Specified by:
getId
in interfaceIdentifiable
-
getIndex
public int getIndex() -
getStackSize
public int getStackSize() -
getDefinition
- Specified by:
getDefinition
in interfaceDefined<RSItemDefinition,
ItemDefinition>
-
isStackable
public boolean isStackable() -
isNoted
public boolean isNoted() -
isPlaceholder
public boolean isPlaceholder() -
actionOf
- Specified by:
actionOf
in interfaceInteractable
-
getRawActions
- Specified by:
getRawActions
in interfaceActionable
-
getActions
- Specified by:
getActions
in interfaceActionable
-
getSprite
- Parameters:
stackable
- 0 = Never show item quantity number 1 = Always show item quantity number 2 = Only show item quantity number if it's greater than 1
-
toString
-
getBounds
-
equals
-
hashCode
public int hashCode() -
setActionOverride
-
setActionSupplier
-