Exemplo n.º 1
0
  private boolean containsRover(Bidimensional position) {
    boolean contains = false;

    for (Rover rover : rovers) {
      contains =
          rover.getPosition().getAxisX() == position.getAxisX()
              && rover.getPosition().getAxisY() == position.getAxisY();
      if (contains) break;
    }
    return contains;
  }
Exemplo n.º 2
0
 private boolean isInsideArea(Bidimensional position) {
   boolean axisXFits = area.getAxisX() >= position.getAxisX();
   boolean axisYFits = area.getAxisY() >= position.getAxisY();
   return axisXFits && axisYFits;
 }