package colisionDetection;
public class Coordinates {
private final int x;
private final int y;
public Coordinates(int x, int y) {
this.x = x;
this.y = y;
}
public Coordinates(int[] coordinates) {
this(coordinates[0], coordinates[1]);
}
public int getX() {
return x;
}
public int getY() {
return y;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Coordinates that = (Coordinates) o;
if (x != that.x) return false;
if (y != that.y) return false;
return true;
}
@Override
public int hashCode() {
int result = x;
result = 31 * result + y;
return result;
}
}