Package dev.twilite.game.trait
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 TypeMethodDescriptiondefault voidEnqueues the first matching option by text, ignoring case.default booleanReturnstruewhen this interactable has any of the specified options, ignoring case.options()Returns menu options associated with this interactable.booleanselect()Performs the use/select action for this object.booleantarget()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. Returnstruewhen the target action was performed. -
select
boolean select()Performs the use/select action for this object. Returnstruewhen the "Use" action was performed. -
option
Returnstruewhen this interactable has any of the specified options, ignoring case. -
interact
Enqueues the first matching option by text, ignoring case. If no options are supplied, enqueues the first available option.
-