Class InteractablePoint

  • All Implemented Interfaces:
    Interactable, java.io.Serializable, java.lang.Cloneable

    public final class InteractablePoint
    extends java.awt.Point
    implements Interactable
    A java.awt.Point wrapped to provide Interactable functionality, use of this class is HIGHLY discouraged.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.geom.Point2D

        java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
    • Field Summary

      • Fields inherited from class java.awt.Point

        x, y
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean click()
      Clicks this entity in an interactable point
      boolean contains​(java.awt.Point point)
      Checks if the projected bounds of this entity contains the Point provided.
      InteractablePoint getInteractionPoint()
      Gets a point within the entity that can be interacted with.
      @NonNull InteractablePoint getInteractionPoint​(java.awt.Point origin)
      Gets a point within the entity that can be interacted with.
      double getVisibility()
      Returns a rough estimate of how visible this entity is as a percent (0 to 100)
      boolean hasDynamicBounds()  
      boolean interact​(java.util.regex.Pattern action, java.util.regex.Pattern target)
      Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item
      boolean isVisible()
      Whether the entity is visible
      java.lang.String toString()  
      • Methods inherited from class java.awt.Point

        equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate
      • Methods inherited from class java.awt.geom.Point2D

        clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InteractablePoint

        public InteractablePoint​(@NonNull
                                 @NonNull java.awt.Point point)
      • InteractablePoint

        public InteractablePoint​(int x,
                                 int y)
    • Method Detail

      • isVisible

        public boolean isVisible()
        Description copied from interface: Interactable
        Whether the entity is visible
        Specified by:
        isVisible in interface Interactable
        Returns:
        true if visible, and false if not visible
      • getVisibility

        public double getVisibility()
        Description copied from interface: Interactable
        Returns a rough estimate of how visible this entity is as a percent (0 to 100)
        Specified by:
        getVisibility in interface Interactable
      • getInteractionPoint

        public InteractablePoint getInteractionPoint()
        Description copied from interface: Interactable
        Gets a point within the entity that can be interacted with. Assumes the origin is the current mouse position.
        Specified by:
        getInteractionPoint in interface Interactable
        Returns:
        an InteractablePoint if available, otherwise null
      • getInteractionPoint

        @NonNull
        public @NonNull InteractablePoint getInteractionPoint​(java.awt.Point origin)
        Description copied from interface: Interactable
        Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.
        Specified by:
        getInteractionPoint in interface Interactable
      • contains

        public boolean contains​(java.awt.Point point)
        Description copied from interface: Interactable
        Checks if the projected bounds of this entity contains the Point provided.
        Specified by:
        contains in interface Interactable
        Returns:
      • click

        public boolean click()
        Description copied from interface: Interactable
        Clicks this entity in an interactable point
        Specified by:
        click in interface Interactable
        Returns:
        true if successfully clicked
      • interact

        public boolean interact​(java.util.regex.Pattern action,
                                java.util.regex.Pattern target)
        Description copied from interface: Interactable
        Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item
        Specified by:
        interact in interface Interactable
        Parameters:
        action - The pattern to match the action with, if null it's ignored
        target - The pattern to match the target with, if null it's ignored
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.awt.Point