Class AbstractMouseDestination<T>
- java.lang.Object
-
- org.dreambot.api.input.mouse.destination.AbstractMouseDestination<T>
-
- Type Parameters:
T- the type parameter
- Direct Known Subclasses:
EntityDestination,MiniMapTileDestination,PointDestination,ShapeDestination,TileDestination
public abstract class AbstractMouseDestination<T> extends java.lang.ObjectCreated with IntelliJ IDEA.- Since:
- : 2/9/2015 Time : 5:42 PM
-
-
Field Summary
Fields Modifier and Type Field Description static intAREA_DESTINATIONstatic intENTITY_DESTINATIONstatic intMINIMAP_DESTINATIONstatic intNULLstatic intPOINT_DESTINATIONstatic intPOLYGON_DESTINATIONstatic intRECTANGLE_DESTINATIONstatic intSHAPE_DESTINATIONstatic intTILE_DESTINATION
-
Constructor Summary
Constructors Constructor Description AbstractMouseDestination(T destination)Creates a new Abstract Mouse Destination from a generic type.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanInteract()Evaluates whether an interaction for this mouse destination is allowed to be performed.booleancanInteract(java.lang.String action)booleancontains(java.awt.Point point)Determines if point is contained inside of destination shape.booleancontains(AbstractMouseDestination destination)Determines if point is contained inside of destination shape.booleancontainsMouse()Determines if the destination shape contains the mouse.java.awt.geom.AreagetArea()Gets the area of the abstract destination shape.java.awt.RectanglegetBoundingBox()Gets the bounding box of the abstract destination shape.java.awt.PointgetCenterPoint()Gets the center point within the bounding box of this mouse destination.java.awt.RectanglegetContainmentBounds()Gets the rectangle to contain the mouse inside.abstract java.awt.ShapegetDestinationShape()Gets the abstract destination shape.ConditiongetInterrupt()java.awt.PointgetSuitablePoint()Gets a gaussian distributed offset point within the bounding box of this mouse destination.TgetTarget()Gets destination target.booleanhandleCamera()Handles camera portion of event interaction.booleanhandleCamera(boolean withZoom, Condition interrupt)Handles camera portion of event interaction.booleanhandleWalk()Handles walking portion of event interactions.abstract booleanisVisible()Determines whether this destination is visible.voidsetContainmentBounds(java.awt.Rectangle containmentBounds)Sets containment bounds rectangle.voidsetInterrupt(Condition interrupt)java.lang.StringtoString()inttype()Mouse destination type id.booleanvalid()Determines if the current destination is valid and visible.booleanverifyPostInteract()Verification/callback after your interaction has been completedEntityDestinationwould implement this to check for crosshair color, for example.
-
-
-
Field Detail
-
NULL
public static final int NULL
- See Also:
- Constant Field Values
-
POINT_DESTINATION
public static final int POINT_DESTINATION
- See Also:
- Constant Field Values
-
ENTITY_DESTINATION
public static final int ENTITY_DESTINATION
- See Also:
- Constant Field Values
-
AREA_DESTINATION
public static final int AREA_DESTINATION
- See Also:
- Constant Field Values
-
SHAPE_DESTINATION
public static final int SHAPE_DESTINATION
- See Also:
- Constant Field Values
-
RECTANGLE_DESTINATION
public static final int RECTANGLE_DESTINATION
- See Also:
- Constant Field Values
-
POLYGON_DESTINATION
public static final int POLYGON_DESTINATION
- See Also:
- Constant Field Values
-
MINIMAP_DESTINATION
public static final int MINIMAP_DESTINATION
- See Also:
- Constant Field Values
-
TILE_DESTINATION
public static final int TILE_DESTINATION
- See Also:
- Constant Field Values
-
-
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
Rectanglebounding 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
Areagenerated 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 completedEntityDestinationwould 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:
toStringin classjava.lang.Object
-
getInterrupt
public Condition getInterrupt()
-
setInterrupt
public void setInterrupt(Condition interrupt)
-
-