Class Interactable

  • Direct Known Subclasses:
    Entity

    public abstract class Interactable
    extends java.lang.Object
    Created with IntelliJ IDEA. User: NotoriousPP Date: 7/29/2014 Time: 12:31 PM
    • Constructor Summary

      Constructors 
      Constructor Description
      Interactable()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.awt.Point getCenterPoint()
      Gets center point of the object, which is used as a base location.
      abstract java.awt.Point getClickablePoint()
      Gets a clickable point within the object, used for interaction.
      boolean hover​(java.lang.String action, Condition interrupt)  
      boolean interact()
      Interacts with the given object using a default left click.
      boolean interact​(java.lang.String action)
      Interacts with the given object using an action.
      boolean interact​(java.lang.String action, boolean rightClick, boolean forceRightClick)  
      boolean interact​(java.lang.String action, boolean rightClick, boolean forceRightClick, Condition interrupt)  
      boolean interact​(Filter<java.lang.String> filter)
      Interacts with the given object using the first matching action.
      boolean interactForceLeft​(java.lang.String action)
      Interacts with current object by forcing a left click.
      boolean interactForceRight​(java.lang.String action)
      Interacts with current object by forcing a right click and interacting with menu (Interact using Menus)
      boolean rightClick​(Condition interrupt)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Interactable

        public Interactable()
    • Method Detail

      • getCenterPoint

        public abstract java.awt.Point getCenterPoint()
        Gets center point of the object, which is used as a base location.
        Returns:
        the center point of the given object.
      • getClickablePoint

        public abstract java.awt.Point getClickablePoint()
        Gets a clickable point within the object, used for interaction.
        Returns:
        a clickable point within the object.
      • interact

        public boolean interact()
        Interacts with the given object using a default left click.
        Returns:
        results of interaction, true if the object was successfully clicked.
      • interact

        public boolean interact​(java.lang.String action)
        Interacts with the given object using an action. Will choose best click type using menu index.

        Example:

        
         NPC man = NPCs.closest("Man");
        
         if (man != null && man.interact("Attack")) {
             log("We attacked a man successfully!");
         }
         
        Parameters:
        action - the action
        Returns:
        results of interaction, true if interaction with the object was successful, otherwise false.
      • interact

        public boolean interact​(Filter<java.lang.String> filter)
        Interacts with the given object using the first matching action.
        Parameters:
        filter - the action filter
        Returns:
        results of interaction, true if interaction with the object was successful, otherwise false.
      • interactForceRight

        public boolean interactForceRight​(java.lang.String action)
        Interacts with current object by forcing a right click and interacting with menu (Interact using Menus)
        Parameters:
        action - the action which to use for interacting.
        Returns:
        the result of the interaction, true if successful, otherwise false.
      • interactForceLeft

        public boolean interactForceLeft​(java.lang.String action)
        Interacts with current object by forcing a left click. (Interact without using Menus)
        Parameters:
        action - the action which to check for before clicking.
        Returns:
        the result of the interaction, true if successful, otherwise false.
      • interact

        public boolean interact​(java.lang.String action,
                                boolean rightClick,
                                boolean forceRightClick)
      • interact

        public boolean interact​(java.lang.String action,
                                boolean rightClick,
                                boolean forceRightClick,
                                Condition interrupt)
      • rightClick

        public boolean rightClick​(Condition interrupt)
      • hover

        public boolean hover​(java.lang.String action,
                             Condition interrupt)