Interface Interactable

All Known Subinterfaces:
InteractableUnit
All Known Implementing Classes:
Actor, IfComponent, Item, Npc, Player, SceneObject, TileItem, WorldEntity

public interface Interactable
Object that can expose and enqueue game menu options.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    interact(String... options)
    Enqueues the first matching option by text, ignoring case.
    default boolean
    option(String... options)
    Returns true when this interactable has any of the specified options, ignoring case.
    Returns menu options associated with this interactable.
    boolean
    Performs the use/select action for this object.
    boolean
    Performs the target action used when a selected component/item/spell targets this object.
  • Method Details

    • options

      List<MenuOption> options()
      Returns menu options associated with this interactable.
    • target

      boolean target()
      Performs the target action used when a selected component/item/spell targets this object. Returns true when the target action was performed.
    • select

      boolean select()
      Performs the use/select action for this object. Returns true when the "Use" action was performed.
    • option

      default boolean option(String... options)
      Returns true when this interactable has any of the specified options, ignoring case.
    • interact

      default void interact(String... options)
      Enqueues the first matching option by text, ignoring case. If no options are supplied, enqueues the first available option.