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 enum
The 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 TypeMethodDescriptionboolean
Performs the specified action on this object.boolean
Performs the specified action on this object.boolean
doClick()
Left-clicks this object.boolean
doClick
(boolean leftClick) Clicks this object.boolean
doHover()
Moves the mouse over this object.boolean
getArea()
Gets the area of tiles covered by this object.net.runelite.api.ObjectComposition
getDef()
Gets the object definition of this object.int
getID()
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.TileObject
getObj()
Gets the TileObject associated with this RSObjectgetType()
Returns this object's type.int
hashCode()
boolean
Checks if the RSObject is clickable (interactive)boolean
Determines whether this object is on the game screen.void
Gets the client thread provider from the clientUI to allow passing runnables to itboolean
turnTo()
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 enumeratedtypes
plane
- 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:
getLocation
in 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
null
if unavailable.
-
isOnScreen
public boolean isOnScreen()Determines whether this object is on the game screen.- Returns:
true
if 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:
turnTo
in interfacePositionable
- Returns:
true
If RSObject is on screen after attempted to move camera angle.
-
isClickable
public boolean isClickable()Checks if the RSObject is clickable (interactive)- Specified by:
isClickable
in interfaceClickable07
- Returns:
true
if 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
-