Exemplo n.º 1
0
  /**
   * 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;
          }
        });
  }
Exemplo n.º 2
0
 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);
         }
       });
 }
Exemplo n.º 3
0
 public boolean hover() {
   return Mouse.apply(
       this,
       new Filter<Point>() {
         public boolean accept(final Point point) {
           return true;
         }
       });
 }
Exemplo n.º 4
0
 public boolean click(final boolean left) {
   return Mouse.apply(
       this,
       new Filter<Point>() {
         public boolean accept(final Point point) {
           Mouse.click(left);
           return true;
         }
       });
 }