Othello/src/othello/Point.java
2021-02-23 14:28:01 +01:00

33 lines
448 B
Java

package othello;
import othello.players.Player;
public class Point {
private int x;
private int y;
public Point(int y, int x) {
this.x = x;
this.y = y;
}
public boolean isJump(Point other, Player[][] board) {
return (board[(x+other.getX())/2][(y+other.getY())/2] != null);
}
public int getX(){
return x;
}
public int getY(){
return y;
}
@Override
public String toString () {
return "(" + y + ", " + x + ")";
}
}