Class SceneObject

java.lang.Object
dev.twilite.game.wrapper.SceneObject
All Implemented Interfaces:
Id, Interactable, InteractableUnit, Unit

public class SceneObject extends Object implements InteractableUnit, Id
Scene object wrapper for walls, decorations, and ground objects.
  • Field Details

  • Method Details

    • world

      public World world()
      Description copied from interface: Unit
      Returns the world this unit belongs to.
      Specified by:
      world in interface Unit
    • coord

      public Coord coord()
      Description copied from interface: Unit
      Returns this unit's world coordinate.
      Specified by:
      coord in interface Unit
    • fine

      public Coord.Fine fine()
      Description copied from interface: Unit
      Returns this unit's fine coordinate, representing its model location.
      Specified by:
      fine in interface Unit
    • map

      public Coord.Map map()
      Description copied from interface: Unit
      Returns this unit's map coordinate relative to the loaded world area.
      Specified by:
      map in interface Unit
    • area

      public Rect area()
      Description copied from interface: Unit
      Returns the area this unit occupies.
      Specified by:
      area in interface Unit
    • layer

      public int layer()
      Returns the scene object layer.
    • baseId

      public int baseId()
      Returns the raw object definition id before transforms.
    • id

      public int id()
      Returns the transformed object definition id.
      Specified by:
      id in interface Id
    • constantName

      public String constantName()
      Description copied from interface: Id
      Returns the generated gameval constant name for Id.id(), or the numeric id as text when no constant is known.

      This is intended for logs and diagnostics where a stable symbolic name is easier to read than a raw number.

      Specified by:
      constantName in interface Id
    • name

      public String name()
      Returns the standardized transformed object name when the cache definition is available. Standardized text is tag-stripped, trimmed, and lowercased.
    • integerParameter

      public OptionalInt integerParameter(int id)
      Returns an integer cache parameter from the current object definition.
    • objectParameter

      public Optional<Object> objectParameter(int id)
      Returns a raw cache parameter from the current object definition.
    • shape

      public int shape()
      Returns the object shape.
    • config

      public int config()
      Returns the raw scene object config.
    • approach

      public Set<Coord> approach()
      Returns coords from which this object can be interacted with. This does not account for path reachability.
    • options

      public List<MenuOption> options()
      Returns object menu options from the current definition.
      Specified by:
      options in interface Interactable
    • target

      public boolean target()
      Enqueues the selected-target-on-object action.
      Specified by:
      target in interface Interactable
    • select

      public boolean select()
      Enqueues the selected-use-on-object action.
      Specified by:
      select in interface Interactable