java.lang.Object
net.botwithus.rs3.game.hud.interfaces.Component
- All Implemented Interfaces:
Interactable<Integer>
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionComponent
(int type, int spriteId, int interfaceIndex, int componentIndex, int subComponentIndex, int properties, String text, int fontId, int textColor, int textAlpha, int itemId, int itemAmount, @NotNull String[] options, @NotNull ComponentParam[] params) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns a defaultFunction
that throws anUnsupportedOperationException
when called.int
int
int
Gets the options available for this InteractablegetParam
(int id) Gets params related to this componentComponent properties that tells you if the component is draggable or a dialogue.int
int
getText()
int
int
getType()
int
hashCode()
boolean
interact()
Executes the action in index 0.boolean
Executes the action associated with the given option.void
setOptionMapper
(Function<Integer, Integer> mapper) toString()
Methods inherited from interface net.botwithus.rs3.game.annotations.Interactable
interact, interact, interact
-
Constructor Details
-
Component
public Component(int type, int spriteId, int interfaceIndex, int componentIndex, int subComponentIndex, int properties, String text, int fontId, int textColor, int textAlpha, int itemId, int itemAmount, @NotNull @NotNull String[] options, @NotNull @NotNull ComponentParam[] params)
-
-
Method Details
-
setOptionMapper
-
getType
-
getInterfaceIndex
public int getInterfaceIndex() -
getComponentIndex
public int getComponentIndex() -
getSubComponentIndex
public int getSubComponentIndex() -
getText
-
getTextFontId
public int getTextFontId() -
getTextColor
-
getTextAlpha
public int getTextAlpha() -
getItemId
public int getItemId() -
getItemAmount
public int getItemAmount() -
getSpriteId
public int getSpriteId() -
interact
public boolean interact()Executes the action in index 0.- Returns:
- true if the action was successful, false otherwise
-
interact
Executes the action associated with the given option.- Specified by:
interact
in interfaceInteractable<Integer>
- Parameters:
option
- the option to execute- Returns:
true
if the action was executed successfully,false
otherwise
-
getOptions
Description copied from interface:Interactable
Gets the options available for this Interactable- Specified by:
getOptions
in interfaceInteractable<Integer>
- Returns:
- a list of strings containing the options
-
equals
-
hashCode
public int hashCode() -
getParams
Gets params related to this component- Returns:
- the params list
-
getParam
-
toString
-
getDefaultMapper
Description copied from interface:Interactable
Returns a defaultFunction
that throws anUnsupportedOperationException
when called.- Specified by:
getDefaultMapper
in interfaceInteractable<Integer>
- Returns:
- a default
Function
-
getProperties
Component properties that tells you if the component is draggable or a dialogue.- Returns:
- the properties of this component
-