2021-02-10 12:01:51 +01:00
|
|
|
package othello;
|
|
|
|
|
|
|
|
public class Point {
|
|
|
|
|
|
|
|
public int x;
|
|
|
|
public int y;
|
|
|
|
|
|
|
|
public Point(int x, int y) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isJump(Point other) {
|
|
|
|
return Math.pow(other.x - this.x, 2) + Math.pow(other.y - this.y, 2) == 4;
|
|
|
|
}
|
2021-02-10 13:01:47 +01:00
|
|
|
public int getX(){
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
public int getY(){
|
|
|
|
return y;
|
|
|
|
}
|
2021-02-10 12:01:51 +01:00
|
|
|
|
2021-02-10 13:35:22 +01:00
|
|
|
@Override
|
|
|
|
public String toString () {
|
|
|
|
return "("+x+","+y+")";
|
|
|
|
}
|
|
|
|
|
2021-02-10 12:01:51 +01:00
|
|
|
}
|