Class AbstractMouseDestination<T>

    • Field Detail

      • NULL

        public static int NULL
      • POINT_DESTINATION

        public static int POINT_DESTINATION
      • ENTITY_DESTINATION

        public static int ENTITY_DESTINATION
      • AREA_DESTINATION

        public static int AREA_DESTINATION
      • SHAPE_DESTINATION

        public static int SHAPE_DESTINATION
      • RECTANGLE_DESTINATION

        public static int RECTANGLE_DESTINATION
      • POLYGON_DESTINATION

        public static int POLYGON_DESTINATION
      • MINIMAP_DESTINATION

        public static int MINIMAP_DESTINATION
      • TILE_DESTINATION

        public static int TILE_DESTINATION
    • 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.
      • handleWalk

        public boolean handleWalk()
        Handles walking portion of event interactions. This is used internally by interact()
        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 .
      • getClient

        public Client getClient()
        Gets current client context.
        Returns:
        the client context.
      • 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)