java.lang.Object
net.botwithus.rs3.game.hud.interfaces.Component
- All Implemented Interfaces:
Interactable<Integer>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionComponent(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 TypeMethodDescriptionbooleanintReturns a defaultFunctionthat throws anUnsupportedOperationExceptionwhen called.intintintGets 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.intintgetText()intintgetType()inthashCode()booleaninteract()Executes the action in index 0.booleanExecutes the action associated with the given option.voidsetOptionMapper(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:
interactin interfaceInteractable<Integer>- Parameters:
option- the option to execute- Returns:
trueif the action was executed successfully,falseotherwise
-
getOptions
Description copied from interface:InteractableGets the options available for this Interactable- Specified by:
getOptionsin 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:InteractableReturns a defaultFunctionthat throws anUnsupportedOperationExceptionwhen called.- Specified by:
getDefaultMapperin 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
-