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 anItem
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
Constructors Constructor Description Item(int index, int id, int stackSize, InterfaceAddress address)
-
Method Summary
-
Methods inherited from interface org.rspeer.game.adapter.type.Actionable
containsAction, containsAction
-
-
-
-
Constructor Detail
-
Item
public Item(int index, int id, int stackSize, InterfaceAddress address)
-
-
Method Detail
-
unbound
public static Item unbound(int index, int id, int stackSize)
-
combine
public static Item combine(RSInventory inv, InterfaceComponent component, int index)
-
parent
public static Item parent(RSInventory inv, InterfaceComponent component)
-
from
public static Item from(InterfaceComponent component)
-
direct
public static Item direct(RSInventory inv, InterfaceComponent component)
-
direct
public static Item direct(boolean forceComponent, RSInventory inv, InterfaceComponent component)
-
getTableElement
public static Item getTableElement(InterfaceComponent component, int index)
-
isNullId
public static boolean isNullId(int id)
-
getComponent
public InterfaceComponent getComponent()
-
isUnbound
public boolean isUnbound()
-
getId
public int getId()
- Specified by:
getId
in interfaceIdentifiable
-
getIndex
public int getIndex()
-
getStackSize
public int getStackSize()
-
getDefinition
public ItemDefinition getDefinition()
- Specified by:
getDefinition
in interfaceDefined<RSItemDefinition,ItemDefinition>
-
isStackable
public boolean isStackable()
-
isNoted
public boolean isNoted()
-
isPlaceholder
public boolean isPlaceholder()
-
actionOf
public MenuAction actionOf(String action)
- Specified by:
actionOf
in interfaceInteractable
-
getRawActions
public String[] getRawActions()
- Specified by:
getRawActions
in interfaceActionable
-
getActions
public List<String> getActions()
- Specified by:
getActions
in interfaceActionable
-
getSprite
public CompletableFuture<Sprite> getSprite(int border, int shadow, int stackable, boolean noted)
- 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
-
getBounds
public Rectangle getBounds()
-
setActionOverride
public void setActionOverride(BiFunction<Item,String,MenuAction> actionOverride)
-
-