Class ObjectDefinition

java.lang.Object
com.valhalla.sdk.api.entities.ObjectDefinition
All Implemented Interfaces:
Identifiable, Nameable

public final class ObjectDefinition extends Object implements Identifiable, Nameable
Immutable, revision-pinned cache definition for one scene object.

Action entries retain their cache slot, including empty entries, so the list index maps directly to ObjectAction. Definition metadata proves semantic identity; the containing SceneObject still supplies the currently loaded tile and native scene-container type.

  • Constructor Details

    • ObjectDefinition

      public ObjectDefinition(int id, String name, List<String> actions, int sizeX, int sizeY, int interactType, int wallOrDoor, boolean obstructsGround, boolean blocksProjectile, int transformVarbit, int transformVarp, List<Integer> transforms)
      Creates one complete immutable cache definition.
      Parameters:
      id - object definition identifier
      name - exact cache name, or blank for the cache's null sentinel
      actions - cache action slots zero through four; empty entries are retained
      sizeX - unrotated object width in tiles
      sizeY - unrotated object height in tiles
      interactType - cache interaction/collision type
      wallOrDoor - cache wall-or-door marker
      obstructsGround - cache ground-obstruction marker
      blocksProjectile - cache projectile-blocking marker
      transformVarbit - transform selector varbit, or -1
      transformVarp - transform selector varp, or -1
      transforms - ordered transform definition identifiers
  • Method Details

    • getId

      public int getId()
      Description copied from interface: Identifiable
      Returns the client definition or item identifier captured in this snapshot.
      Specified by:
      getId in interface Identifiable
      Returns:
      object definition identifier
    • getName

      public String getName()
      Description copied from interface: Nameable
      Returns the captured display name.
      Specified by:
      getName in interface Nameable
      Returns:
      exact cache name, or blank for the cache's null sentinel
    • getActions

      public List<String> getActions()
      Returns:
      immutable cache action slots in native menu order
    • getAction

      public String getAction(ObjectAction action)
      Returns the exact cache label for a typed menu slot.
      Parameters:
      action - typed object-action slot
      Returns:
      the slot label, possibly blank, or empty when the cache list is shorter
    • findAction

      public Optional<ObjectAction> findAction(String action)
      Resolves an exact cache action label back to its typed native slot.
      Parameters:
      action - exact, case-sensitive cache action label
      Returns:
      matching typed action, or empty when absent or ambiguous
    • hasAction

      public boolean hasAction(String action)
      Tests whether an exact cache action is present in any slot.
      Parameters:
      action - exact, case-sensitive cache action label
      Returns:
      whether the label is present
    • getSizeX

      public int getSizeX()
      Returns:
      unrotated object width in tiles
    • getSizeY

      public int getSizeY()
      Returns:
      unrotated object height in tiles
    • getInteractType

      public int getInteractType()
      Returns:
      cache interaction/collision type
    • getWallOrDoor

      public int getWallOrDoor()
      Returns:
      cache wall-or-door marker
    • obstructsGround

      public boolean obstructsGround()
      Returns:
      whether the cache marks this object as obstructing ground
    • blocksProjectile

      public boolean blocksProjectile()
      Returns:
      whether the cache marks this object as blocking projectiles
    • getTransformVarbit

      public int getTransformVarbit()
      Returns:
      transform selector varbit, or -1
    • getTransformVarp

      public int getTransformVarp()
      Returns:
      transform selector varp, or -1
    • getTransforms

      public List<Integer> getTransforms()
      Returns:
      immutable ordered transform definition identifiers
    • equals

      public boolean equals(Object value)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object