Exemplo n.º 1
0
 /**
  * Am I in the search zone?
  *
  * @return
  */
 public static boolean inSearchZone() {
   Coordinate now = Configuration.getInstance().getCurrentLocation();
   Coordinate[] bl = Configuration.getInstance().getFlagZone();
   return (now.getX() > bl[0].getX()
           && now.getX() < bl[1].getX()
           && now.getY() > bl[0].getY()
           && now.getY() < bl[1].getY())
       && !nearWall();
 }
Exemplo n.º 2
0
  /**
   * Is the robot near a wall?
   *
   * @return
   */
  public static boolean nearWall() {
    Coordinate now = Configuration.getInstance().getCurrentLocation();

    return now.getX() < 25 || now.getY() < 25 || now.getX() > 305 || now.getY() > 305;
  }