Othello/src/othello/Point.java

31 lines
414 B
Java
Raw Normal View History

package othello;
public class Point {
private int x;
private int y;
public Point(int y, int x) {
this.x = x;
this.y = y;
}
2021-02-22 21:17:10 +01:00
public boolean isJump(Point other,State game) {
return (game.board[(x+other.getX())/2][(y+other.getY())/2] != null);
}
2021-02-12 09:57:05 +01:00
2021-02-10 13:01:47 +01:00
public int getX(){
return x;
}
2021-02-12 09:57:05 +01:00
2021-02-10 13:01:47 +01:00
public int getY(){
return y;
}
2021-02-10 13:35:22 +01:00
@Override
public String toString () {
return "(" + y + ", " + x + ")";
2021-02-10 13:35:22 +01:00
}
}