Package rsb.wrappers
Class RSObject
java.lang.Object
rsb.methods.MethodProvider
rsb.wrappers.RSObject
- All Implemented Interfaces:
Clickable,Clickable07,Positionable
A wrapper for a tile object which interprets the underlying tile objects type and furthermore
acts as a factory for the RSModel of the RSObject (refer to getModel for better explanation)
RSObject can represent any
types game object-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of game object Game, Decorative, Ground, or Wall -
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods -
Constructor Summary
ConstructorsConstructorDescriptionRSObject(MethodContext ctx, net.runelite.api.TileObject obj, RSObject.Type type, int plane) Creates a new RSObject with the following parameters: -
Method Summary
Modifier and TypeMethodDescriptionbooleanPerforms the specified action on this object.booleanPerforms the specified action on this object.booleandoClick()Left-clicks this object.booleandoClick(boolean leftClick) Clicks this object.booleandoHover()Moves the mouse over this object.booleangetArea()Gets the area of tiles covered by this object.net.runelite.api.ObjectCompositiongetDef()Gets the object definition of this object.intgetID()Gets the ID of this object.Gets the RSTile on which this object is centered.getModel()Gets the Model of this object.getName()Returns the name of the object.Returns the name of the object.net.runelite.api.TileObjectgetObj()Gets the TileObject associated with this RSObjectgetType()Returns this object's type.inthashCode()booleanChecks if the RSObject is clickable (interactive)booleanDetermines whether this object is on the game screen.voidGets the client thread provider from the clientUI to allow passing runnables to itbooleanturnTo()Turns the camera towards the RSObject.
-
Constructor Details
-
RSObject
Creates a new RSObject with the following parameters:- Parameters:
ctx- The context in which the object exists (the singleton RuneLite)obj- The TileObject which this RSObject is associated withtype- The type of game object corresponding to the enumeratedtypesplane- The plane that this object exists on
-
-
Method Details
-
getLocation
Gets the RSTile on which this object is centered. An RSObject may cover multiple tiles, in which case this will return the floored central tile.- Specified by:
getLocationin interfacePositionable- Returns:
- The central RSTile.
- See Also:
-
getArea
Gets the area of tiles covered by this object.- Returns:
- The RSArea containing all the tiles on which this object can be found.
-
getDef
public net.runelite.api.ObjectComposition getDef()Gets the object definition of this object.- Returns:
- The RSObjectDef if available, otherwise
null.
-
setClientThreadProvider
public void setClientThreadProvider()Gets the client thread provider from the clientUI to allow passing runnables to it -
getID
public int getID()Gets the ID of this object.- Returns:
- The ID.
-
getName
Returns the name of the object.- Parameters:
object- The object to look up.- Returns:
- The object name if the definition is available; otherwise "".
-
getName
Returns the name of the object.- Returns:
- The object name if the definition is available; otherwise "".
-
getModel
Gets the Model of this object. Checks what kind of object it is and returns the model of the object based on that- Returns:
- The RSModel, or
nullif unavailable.
-
isOnScreen
public boolean isOnScreen()Determines whether this object is on the game screen.- Returns:
trueif the object is on screen elsefalse
-
getType
Returns this object's type.- Returns:
- The type of the object.
-
doAction
Performs the specified action on this object. -
doAction
Performs the specified action on this object. -
doClick
public boolean doClick()Left-clicks this object. -
doClick
public boolean doClick(boolean leftClick) Clicks this object. -
doHover
public boolean doHover()Moves the mouse over this object. -
equals
-
hashCode
public int hashCode() -
turnTo
public boolean turnTo()Turns the camera towards the RSObject.- Specified by:
turnToin interfacePositionable- Returns:
trueIf RSObject is on screen after attempted to move camera angle.
-
isClickable
public boolean isClickable()Checks if the RSObject is clickable (interactive)- Specified by:
isClickablein interfaceClickable07- Returns:
trueif the object is capable of being interacted with otherwisefalse
-
getObj
public net.runelite.api.TileObject getObj()Gets the TileObject associated with this RSObject- Returns:
- the TileObject else null
-