Compare commits
No commits in common. "b5dc5a42283e88041b678cc21da9e55d19212bb4" and "45f754415178494cdafbc6a92089449f89556145" have entirely different histories.
b5dc5a4228
...
45f7544151
1 changed files with 2 additions and 9 deletions
|
@ -5,17 +5,10 @@ public class Knight extends Piece {
|
||||||
super(black);
|
super(black);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position) {
|
public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position) {
|
||||||
ArrayList<BoardCoordinate> possibleMoves = new ArrayList<>();
|
ArrayList<BoardCoordinate> possibleMoves = new ArrayList<>();
|
||||||
possibleMoves.add(new BoardCoordinate(position.x - 2, position.y - 1));
|
possibleMoves.add(new BoardCoordinate(position.x, position.y - 1)); // to up
|
||||||
possibleMoves.add(new BoardCoordinate(position.x - 1, position.y - 2));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x + 1, position.y - 2));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x + 2, position.y - 1));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x + 2, position.y + 1));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x + 1, position.y + 2));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x - 1, position.y + 2));
|
|
||||||
possibleMoves.add(new BoardCoordinate(position.x - 2, position.y + 1));
|
|
||||||
// test
|
|
||||||
return possibleMoves;
|
return possibleMoves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue