fonction getMoves pour clone et saut

This commit is contained in:
Antonin Boyon 2021-02-10 12:38:25 +01:00
parent e675b8ae59
commit 02821f1886

View File

@ -47,7 +47,7 @@ public class State {
if (this.board[y+deltaY][x+deltaX]==0) { if (this.board[y+deltaY][x+deltaX]==0) {
moves.add(new Pair<Point, Point>(new Point(y, x), new Point(y+deltaY, x+deltaX))); moves.add(new Pair<Point, Point>(new Point(y, x), new Point(y+deltaY, x+deltaX)));
} }
if(deltaX == 0 ^ deltaY == 0){ if(this.board[y+deltaY][x+deltaX]!=0){
if(this.board[y+2*deltaY][x+2*deltaX] == 0) if(this.board[y+2*deltaY][x+2*deltaX] == 0)
moves.add(new Pair<Point, Point>(new Point(y, x), new Point(y+2*deltaY, x+2*deltaX))); moves.add(new Pair<Point, Point>(new Point(y, x), new Point(y+2*deltaY, x+2*deltaX)));