improved the highlight thingy. the enpassant needs reviewing
This commit is contained in:
parent
a399856219
commit
4fadb597ab
|
|
@ -7,10 +7,12 @@ public class MoveHighlighter {
|
|||
ArrayList<int[]> validMoves = new ArrayList<int[]>();
|
||||
MovePiece movement = new MovePiece(piece, board);
|
||||
PieceType type= piece.getType();
|
||||
|
||||
//looping through each square space
|
||||
for (int x = 0; x < board.getWidth(); x++) {
|
||||
for (int y = 0; y < board.getHeight(); y++) {
|
||||
boolean valid=false;
|
||||
System.out.println("MoveHighlighter: checking (" + x + "," + y + ") for type " + type);
|
||||
|
||||
if(type==PieceType.Pawn) {
|
||||
valid=movement.movePawnSimulate(x, y);
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ public class MovePiece {
|
|||
int stepY = (targetY > currentY) ? 1 : -1;
|
||||
int x = currentX + stepX;
|
||||
int y = currentY + stepY;
|
||||
while (x != targetX && y != targetY) {
|
||||
while (x != targetX) {
|
||||
if (board.getPiece(x, y) != null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue