Class AbstractMouseDestination<T>

    • Constructor Detail

      • AbstractMouseDestination

        public AbstractMouseDestination​(T destination)
        Creates a new Abstract Mouse Destination from a generic type.
        Parameters:
        destination - Your destination, generic
    • Method Detail

      • getTarget

        public T getTarget()
        Gets destination target.
        Returns:
        the destination target.
      • getDestinationShape

        public abstract java.awt.Shape getDestinationShape()
        Gets the abstract destination shape.
        Returns:
        The destination shape.
      • getBoundingBox

        public java.awt.Rectangle getBoundingBox()
        Gets the bounding box of the abstract destination shape.
        Returns:
        The Rectangle bounding box of the abstract destination shape.
      • handleCamera

        public boolean handleCamera()
        Handles camera portion of event interaction. This is used internally by interact().
        Returns:
        True if the event succeeded.
      • handleCamera

        public boolean handleCamera​(boolean withZoom,
                                    Condition interrupt)
        Handles camera portion of event interaction. This is used internally by interact().
        Returns:
        True if the event succeeded.
      • handleWalk

        public boolean handleWalk()
        Handles walking portion of event interactions. This is used internally by interact() Default implementation is to just return true, required to override this in any implementations.
        Returns:
        True if the event succeeded or is not needed in the destination implementation.
      • getArea

        public java.awt.geom.Area getArea()
        Gets the area of the abstract destination shape.
        Returns:
        The Area generated from the abstract destination shape.
      • getContainmentBounds

        public java.awt.Rectangle getContainmentBounds()
        Gets the rectangle to contain the mouse inside. Useful for menus.
        Returns:
        The containment bounds rectangle.
      • setContainmentBounds

        public void setContainmentBounds​(java.awt.Rectangle containmentBounds)
        Sets containment bounds rectangle.
        Parameters:
        containmentBounds - the containmentBounds to set, if null will create a default rectangle.
      • isVisible

        public abstract boolean isVisible()
        Determines whether this destination is visible.
        Returns:
        Whether this destination is visible.
      • valid

        public boolean valid()
        Determines if the current destination is valid and visible.
        Returns:
        true if destination is valid and visible.
      • type

        public int type()
        Mouse destination type id.
        Returns:
        the mouse destination type id.
      • getCenterPoint

        public java.awt.Point getCenterPoint()
        Gets the center point within the bounding box of this mouse destination.
        Returns:
        center point of the bounding box of this mouse destination
      • containsMouse

        public boolean containsMouse()
        Determines if the destination shape contains the mouse.
        Returns:
        true if destination shape contains mouse, otherwise false.
      • contains

        public boolean contains​(java.awt.Point point)
        Determines if point is contained inside of destination shape.
        Parameters:
        point - the point which to check.
        Returns:
        true if point is contained inside of shape, otherwise false.
      • contains

        public boolean contains​(AbstractMouseDestination destination)
        Determines if point is contained inside of destination shape.
        Parameters:
        destination - the destination which to check.
        Returns:
        true if point is contained inside of shape, otherwise false.
      • getSuitablePoint

        public java.awt.Point getSuitablePoint()
        Gets a gaussian distributed offset point within the bounding box of this mouse destination.
        Returns:
        point within the bounding box of this mouse destination .
      • canInteract

        public boolean canInteract()
        Evaluates whether an interaction for this mouse destination is allowed to be performed.
        Returns:
        True if an interaction is allowed to be performed.
      • canInteract

        public boolean canInteract​(java.lang.String action)
      • verifyPostInteract

        public boolean verifyPostInteract()
        Verification/callback after your interaction has been completed EntityDestination would implement this to check for crosshair color, for example.
        Returns:
        default of True if not implemented, else return of implementation
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getInterrupt

        public Condition getInterrupt()
      • setInterrupt

        public void setInterrupt​(Condition interrupt)