Class SceneObject

java.lang.Object
com.valhalla.sdk.api.entities.SceneObject
All Implemented Interfaces:
GameObject, Identifiable, Interactable, Locatable, Nameable

public final class SceneObject extends Object implements GameObject
Immutable scene-object snapshot backed by the native action API.
  • Constructor Details

    • SceneObject

      public SceneObject(int id, String name, Tile tile)
      Creates an object snapshot without a decoded scene-container type.
      Parameters:
      id - object definition identifier
      name - captured object name, possibly blank
      tile - world location
    • SceneObject

      public SceneObject(int id, String name, Tile tile, int type)
      Creates an immutable object snapshot.
      Parameters:
      id - object definition identifier
      name - captured object name, possibly blank
      tile - world location
      type - native scene container: 0 boundary, 1 wall decoration, 2 game object, 3 floor decoration, or -1 when unresolved
  • Method Details

    • getId

      public int getId()
      Returns the object definition identifier.
      Specified by:
      getId in interface Identifiable
      Returns:
      object definition identifier
    • getName

      public String getName()
      Returns the captured object name.
      Specified by:
      getName in interface Nameable
      Returns:
      captured object name, possibly blank
    • getType

      public int getType()
      Returns the native scene container category.
      Returns:
      0 boundary, 1 wall decoration, 2 game object, 3 floor decoration, or -1 when unresolved
    • getTile

      public Tile getTile()
      Returns the object's captured location.
      Specified by:
      getTile in interface Locatable
      Returns:
      object world tile
    • interact

      public boolean interact(int action)
      Dispatches a raw object action opcode.
      Specified by:
      interact in interface Interactable
      Parameters:
      action - native action opcode
      Returns:
      true when accepted; verify scene/player state for completion
    • toString

      public String toString()
      Overrides:
      toString in class Object