/** * Clicks a tile on the minimap. * * @param mobile The mobile to click (global). * @return <tt>true</tt> if the mobile was clicked; otherwise <tt>false</tt>. */ public static boolean walk(final Locatable mobile) { Tile stepDirection = mobile.getLocation(); if (!stepDirection.isOnMap()) { stepDirection = getClosestOnMap(stepDirection); } final Tile tile = stepDirection; return Mouse.apply( new ViewportEntity() { public Point getCentralPoint() { return Calculations.worldToMap(tile.getX(), tile.getY()); } public Point getNextViewportPoint() { return getCentralPoint(); } public boolean contains(final Point point) { return getCentralPoint().distance(point) <= 2; } public boolean validate() { return tile.isOnMap(); } }, new Filter<Point>() { public boolean accept(final Point point) { Mouse.click(true); return true; } }); }
public boolean interact(final String action, final String option) { return Mouse.apply( this, new Filter<Point>() { public boolean accept(final Point point) { return Menu.select(action, option); } }); }
public boolean hover() { return Mouse.apply( this, new Filter<Point>() { public boolean accept(final Point point) { return true; } }); }
public boolean click(final boolean left) { return Mouse.apply( this, new Filter<Point>() { public boolean accept(final Point point) { Mouse.click(left); return true; } }); }