package de.sebhn.algorithm.excercise1.helper;

import java.security.InvalidParameterException;

/**
 * This class is responsible for the coordinates of the buttons
 * 
 * @author Phi Long Tran <191624>
 * @author Manuel Wessner <191711>
 * @author Steve Nono <191709>
 */
public class Position {

  // Instance variables
  private int positionX;
  private int positionY;

  // Constructor
  public Position(int positionX, int positionY) {
    if (positionX < 0 || positionY < 0) {
      throw new InvalidParameterException(
          "Position cant be negative x, y " + positionX + positionY);
    }
    this.positionX = positionX;
    this.positionY = positionY;
  }

  public Position getPosition() {
    return this;
  }

  public int getX() {
    return positionX;
  }

  public int getY() {
    return positionY;
  }

  @Override
  public String toString() {
    return "" + positionX + "," + positionY;
  }

  public boolean isEqualsOrBiggerThan(Position other) {
    return getX() >= other.getX() && getY() >= other.getY();
  }

  public boolean isEqualsOrSmallerThan(Position other) {
    return getX() <= other.getX() && getY() <= other.getY();
  }
}

@@ -87,16 +87,42 @@
 ception;
+%0Aimport java.util.Objects;
 %0A%0A/**%0A *
@@ -925,32 +925,338 @@
 positionY;%0A  %7D%0A%0A
+  @Override%0A  public boolean equals(Object obj) %7B%0A    if (obj instanceof Position) %7B%0A      Position other = (Position) obj;%0A      return getX() == other.getX() && getY() == other.getY();%0A    %7D%0A    return false;%0A  %7D%0A%0A  @Override%0A  public int hashCode() %7B%0A    return Objects.hash(positionX, positionY);%0A  %7D%0A%0A
   public boolean

add hashcode/equals