Package com.valhalla.sdk.api.entities
Class SceneObject
java.lang.Object
com.valhalla.sdk.api.entities.SceneObject
- All Implemented Interfaces:
GameObject,Identifiable,Interactable,Locatable,Nameable
Immutable scene-object snapshot backed by the native action API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSentinel for a static object or a client withoutscene-object-animation. -
Constructor Summary
ConstructorsConstructorDescriptionSceneObject(int id, String name, Tile tile) Creates an object snapshot without a decoded scene-container type.SceneObject(int id, String name, Tile tile, int type) Creates an immutable object snapshot.SceneObject(int id, String name, Tile tile, int type, ObjectDefinition definition) Creates an immutable object snapshot with revision-pinned cache metadata.SceneObject(int id, String name, Tile tile, int type, ObjectDefinition definition, int animation) Creates a snapshot that also carries the object's current animation. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the current animation (sequence) id of a dynamic scene object.Returns the revision-pinned cache metadata captured for this object ID.intgetId()Returns the object definition identifier.getName()Returns the captured object name.getTile()Returns the object's captured location.intgetType()Returns the native scene container category.booleanReports whether revision-pinned cache metadata was resolved.booleaninteract(int action) Dispatches a raw object action opcode.booleanisAnimating(int sequenceId) Returns true when this object currently plays the given sequence.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.valhalla.sdk.api.entities.GameObject
interactMethods inherited from interface com.valhalla.sdk.api.entities.Locatable
canReach, canReach, distance, distanceTo, getGridX, getGridY, getPlane, getRegionId, getX, getY, getZ, isInArea, isWithinDistance, walkingDistance
-
Field Details
-
NO_ANIMATION
public static final int NO_ANIMATIONSentinel for a static object or a client withoutscene-object-animation.- See Also:
-
-
Constructor Details
-
SceneObject
Creates an object snapshot without a decoded scene-container type.- Parameters:
id- object definition identifiername- captured object name, possibly blanktile- world location
-
SceneObject
Creates an immutable object snapshot.- Parameters:
id- object definition identifiername- captured object name, possibly blanktile- world locationtype- native scene container: 0 boundary, 1 wall decoration, 2 game object, 3 floor decoration, or-1when unresolved
-
SceneObject
Creates an immutable object snapshot with revision-pinned cache metadata.- Parameters:
id- object definition identifiername- captured object name, possibly blanktile- world locationtype- native scene container: 0 boundary, 1 wall decoration, 2 game object, 3 floor decoration, or-1when unresolveddefinition- revision-pinned cache definition, ornullwhen unavailable
-
SceneObject
public SceneObject(int id, String name, Tile tile, int type, ObjectDefinition definition, int animation) Creates a snapshot that also carries the object's current animation.- Parameters:
id- object definition identifiername- captured object name, possibly blanktile- world locationtype- native scene containerdefinition- revision-pinned cache definition, ornullanimation- current sequence id of an animated (dynamic) object, orNO_ANIMATIONfor a static object or an unsupported client
-
-
Method Details
-
getAnimation
public int getAnimation()Returns the current animation (sequence) id of a dynamic scene object.Static objects and clients without the
scene-object-animationcapability reportNO_ANIMATION.- Returns:
- current sequence id, or
NO_ANIMATION
-
isAnimating
public boolean isAnimating(int sequenceId) Returns true when this object currently plays the given sequence.- Returns:
- true when this object currently plays the given sequence
-
getId
public int getId()Returns the object definition identifier.- Specified by:
getIdin interfaceIdentifiable- Returns:
- object definition identifier
-
getName
Returns the captured object name. -
hasDefinition
public boolean hasDefinition()Reports whether revision-pinned cache metadata was resolved.- Returns:
- whether this snapshot carries an object definition
-
getDefinition
Returns the revision-pinned cache metadata captured for this object ID.- Returns:
- cache definition, or empty when this payload has no matching definition
-
getType
public int getType()Returns the native scene container category.- Returns:
- 0 boundary, 1 wall decoration, 2 game object, 3 floor decoration,
or
-1when unresolved
-
getTile
Returns the object's captured location. -
interact
public boolean interact(int action) Dispatches a raw object action opcode.- Specified by:
interactin interfaceInteractable- Parameters:
action- native action opcode- Returns:
truewhen accepted; verify scene/player state for completion
-
toString
-