Class OSRSEntity
- java.lang.Object
-
- com.runemate.game.api.hybrid.entities.Entity
-
- com.runemate.game.api.osrs.entities.OSRSCacheModelEntity
-
- com.runemate.game.api.osrs.entities.OSRSEntity
-
- All Implemented Interfaces:
Interactable
,Locatable
,Modeled
,Renderable
,LocatableEntity
,Validatable
- Direct Known Subclasses:
OSRSGameObject
,OSRSNpc
,OSRSPlayer
public abstract class OSRSEntity extends OSRSCacheModelEntity
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.awt.Point point)
Checks if the projected bounds of this entity contains the Point provided.Area.Rectangular
getArea(Coordinate regionBase)
Gets the area using the region base as the coordinate to offset from.@Nullable InteractablePoint
getInteractionPoint(java.awt.Point origin)
Gets a point within the entity that can be interacted with.@Nullable Model
getModel()
Gets the polygon-based model of the entitydouble
getVisibility()
Returns a rough estimate of how visible this entity is as a percent (0 to 100)boolean
isHovered()
Gets whether or not this entity is being hovered.boolean
isVisible()
Whether the entity is visiblevoid
render(java.awt.Graphics2D g2d)
Renders this entity onto the givenGraphics2D
, use is discouragedvoid
render(javafx.scene.canvas.GraphicsContext gc)
Renders this entity onto the givenGraphicsContext
java.lang.String
toString()
-
Methods inherited from class com.runemate.game.api.osrs.entities.OSRSCacheModelEntity
click, interact
-
Methods inherited from class com.runemate.game.api.hybrid.entities.Entity
equals, hasDynamicBounds, hashCode, isValid, releaseUidOnGarbageCollection, setBackupModel, setBackupModel, setBackupModel, setForcedModel, setForcedModel, setForcedModel
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
getInteractionPoint, hover, interact, interact, interact, interact, interact
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Locatable
distanceTo, distanceTo, getLocalPosition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.LocatableEntity
getArea, getHighPrecisionPosition, getHighPrecisionPosition, getPosition, getPosition
-
-
-
-
Method Detail
-
getArea
@Nullable public Area.Rectangular getArea(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the area using the region base as the coordinate to offset from. For optimization.- Specified by:
getArea
in interfaceLocatableEntity
- Overrides:
getArea
in classOSRSCacheModelEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
getInteractionPoint
@Nullable public @Nullable InteractablePoint getInteractionPoint(java.awt.Point origin)
Description copied from interface:Interactable
Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.- Specified by:
getInteractionPoint
in interfaceInteractable
- Overrides:
getInteractionPoint
in classOSRSCacheModelEntity
-
isHovered
public boolean isHovered()
Description copied from interface:Interactable
Gets whether or not this entity is being hovered.- Specified by:
isHovered
in interfaceInteractable
- Overrides:
isHovered
in classOSRSCacheModelEntity
- Returns:
- true if the entity is currently being hovered, otherwise false.
-
contains
public boolean contains(java.awt.Point point)
Description copied from interface:Interactable
Checks if the projected bounds of this entity contains the Point provided.- Specified by:
contains
in interfaceInteractable
- Overrides:
contains
in classOSRSCacheModelEntity
- Returns:
-
isVisible
public final boolean isVisible()
Description copied from interface:Interactable
Whether the entity is visible- Specified by:
isVisible
in interfaceInteractable
- Overrides:
isVisible
in classOSRSCacheModelEntity
- Returns:
- true if visible, and false if not visible
-
getVisibility
public final double getVisibility()
Description copied from interface:Interactable
Returns a rough estimate of how visible this entity is as a percent (0 to 100)- Specified by:
getVisibility
in interfaceInteractable
- Overrides:
getVisibility
in classOSRSCacheModelEntity
-
getModel
@Nullable public @Nullable Model getModel()
Description copied from interface:Modeled
Gets the polygon-based model of the entity- Returns:
- the entities model, otherwise the backup if set, if neither are available null
-
render
public void render(java.awt.Graphics2D g2d)
Description copied from interface:Renderable
Renders this entity onto the givenGraphics2D
, use is discouraged- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classEntity
-
render
public void render(javafx.scene.canvas.GraphicsContext gc)
Description copied from interface:Renderable
Renders this entity onto the givenGraphicsContext
- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classEntity
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-