Class OSRSGameObject
- java.lang.Object
-
- com.runemate.game.api.hybrid.entities.Entity
-
- com.runemate.game.api.osrs.entities.OSRSCacheModelEntity
-
- com.runemate.game.api.osrs.entities.OSRSEntity
-
- com.runemate.game.api.osrs.entities.OSRSGameObject
-
- All Implemented Interfaces:
Animable
,Identifiable
,Interactable
,Locatable
,Modeled
,Renderable
,Rotatable
,GameObject
,LocatableEntity
,Validatable
public final class OSRSGameObject extends OSRSEntity implements GameObject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.runemate.game.api.hybrid.entities.GameObject
GameObject.Direction, GameObject.Type
-
-
Constructor Summary
Constructors Constructor Description OSRSGameObject(long uid, @NonNull java.lang.String type, int id, @NonNull Coordinate position)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getAnimationId()
Gets the entities current animation idArea.Rectangular
getArea(Coordinate regionBase)
Gets the area using the region base as the coordinate to offset from.GameObjectDefinition
getDefinition()
Gets the object's definition.GameObject.Direction
getDirection()
int
getHighPrecisionOrientation()
For internal usage only.Coordinate.HighPrecision
getHighPrecisionPosition(Coordinate regionBase)
Gets the high precision position using the region base as the coordinate to offset from.int
getId()
Model
getModel()
Gets the polygon-based model of the entityint
getOrientationAsAngle()
Gets the current orientation as an angle.@NonNull Coordinate
getPosition(Coordinate regionBase)
Gets the position using the region base as the coordinate to offset from.byte
getSpecializedTypeIndicator()
Also known as getObjectModelShape.java.util.Set<java.lang.Integer>
getSpotAnimationIds()
Deprecated.GameObject.Type
getType()
Gets the type of the object(e.g.boolean
isValid()
Verifies whether this entity is valid and still exists, typically on the world-graphjava.lang.String
toString()
-
Methods inherited from class com.runemate.game.api.osrs.entities.OSRSEntity
contains, getInteractionPoint, getVisibility, isHovered, isVisible, render, render
-
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, releaseUidOnGarbageCollection, setBackupModel, setBackupModel, setBackupModel, setForcedModel, setForcedModel, setForcedModel
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.GameObject
getActiveDefinition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
click, contains, getInteractionPoint, getInteractionPoint, getVisibility, hasDynamicBounds, hover, interact, interact, interact, interact, interact, interact, isHovered, isVisible
-
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, getPosition
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Modeled
setBackupModel, setBackupModel, setBackupModel, setForcedModel, setForcedModel, setForcedModel
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Renderable
render, render
-
-
-
-
Constructor Detail
-
OSRSGameObject
public OSRSGameObject(long uid, @NonNull @NonNull java.lang.String type, int id, @NonNull @NonNull Coordinate position)
-
-
Method Detail
-
getAnimationId
public int getAnimationId()
Description copied from interface:Animable
Gets the entities current animation id- Specified by:
getAnimationId
in interfaceAnimable
- Returns:
- the current animation id, or if unavailable -1
-
getModel
public Model getModel()
Description copied from interface:Modeled
Gets the polygon-based model of the entity- Specified by:
getModel
in interfaceModeled
- Overrides:
getModel
in classOSRSEntity
- Returns:
- the entities model, otherwise the backup if set, if neither are available null
-
getSpecializedTypeIndicator
public byte getSpecializedTypeIndicator()
Description copied from interface:GameObject
Also known as getObjectModelShape.0,1,2,3 = BoundaryObject 4,5,6,7,8 = WallObject 9,10,11,12,13,14,15,16,17,18,19,20,21 = PrimaryObject 22 = FloorDecoration
10 is the most common object model shape/type (standard)- Specified by:
getSpecializedTypeIndicator
in interfaceGameObject
- Returns:
-
getId
public int getId()
- Specified by:
getId
in interfaceIdentifiable
-
getType
public GameObject.Type getType()
Description copied from interface:GameObject
Gets the type of the object(e.g. WallObject, FloorDecoration, etc)- Specified by:
getType
in interfaceGameObject
- Returns:
- A String representing the object type
-
getDefinition
public GameObjectDefinition getDefinition()
Description copied from interface:GameObject
Gets the object's definition.- Specified by:
getDefinition
in interfaceGameObject
- Returns:
- The object's definition or null if it's unavailable.
-
getPosition
@NonNull public @NonNull Coordinate getPosition(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the position using the region base as the coordinate to offset from. For optimization.- Specified by:
getPosition
in interfaceLocatableEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
getHighPrecisionPosition
public Coordinate.HighPrecision getHighPrecisionPosition(Coordinate regionBase)
Description copied from interface:LocatableEntity
Gets the high precision position using the region base as the coordinate to offset from. For optimization.- Specified by:
getHighPrecisionPosition
in interfaceLocatableEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
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 classOSRSEntity
- Parameters:
regionBase
- The Coordinate base of the loaded region
-
toString
public java.lang.String toString()
- Overrides:
toString
in classOSRSEntity
-
getHighPrecisionOrientation
public int getHighPrecisionOrientation()
Description copied from interface:Rotatable
For internal usage only. Subject to removal without notice.- Specified by:
getHighPrecisionOrientation
in interfaceRotatable
-
getDirection
public GameObject.Direction getDirection()
- Specified by:
getDirection
in interfaceGameObject
-
getSpotAnimationIds
@Deprecated public java.util.Set<java.lang.Integer> getSpotAnimationIds()
Deprecated.- Specified by:
getSpotAnimationIds
in interfaceGameObject
-
getOrientationAsAngle
public int getOrientationAsAngle()
Description copied from interface:Rotatable
Gets the current orientation as an angle.- Specified by:
getOrientationAsAngle
in interfaceRotatable
-
isValid
public boolean isValid()
Description copied from interface:Validatable
Verifies whether this entity is valid and still exists, typically on the world-graph- Specified by:
isValid
in interfaceValidatable
- Overrides:
isValid
in classEntity
- Returns:
- true if it's still available, otherwise false
-
-