diff --git a/src/backend/Board.java b/src/backend/Board.java index 575e870..e7d807e 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -280,7 +280,7 @@ public class Board { } public boolean isPieceSelected() { - if (selectedX != -1 && selectedY != -1 /*&& board[selectedY][selectedX] != null*/) { + if (selectedX != -1 && selectedY != -1) { return true; } return false; @@ -322,7 +322,6 @@ public class Board { if (enPassant) { secondPieceCoord[0] = clickedX; secondPieceCoord[1] = clickedY; - //move.setEnPassant(enPassant); } playMove(move); turns += 1; @@ -390,16 +389,10 @@ public class Board { public boolean isHighlighted(int x, int y, Board board2) { if (isPieceSelected()) { - //boolean king = hasPieceMoved(PieceType.King, whiteTurn, true); - //boolean rookRight = hasPieceMoved(PieceType.Rook, whiteTurn, true); - //boolean rookLeft = hasPieceMoved(PieceType.Rook, whiteTurn, false); Piece selectedPiece = board[selectedY][selectedX]; moveCalc = new MoveCalculator(board2); ArrayList moves = moveCalc.getMove(selectedPiece.getType(), selectedPiece.isWhite(), selectedX, selectedY); - //this.castlingLeft = moveCalc.getCastlingLeft(); castlingRight = moveCalc.getCastlingRight(); - //this.enPassantX = moveCalc.getEnPassantX(); - //this.enPassantY = moveCalc.getEnPassantY(); for (int i = 0; i < moves.size(); i++) { if (x == moves.get(i)[0] && y == moves.get(i)[1]) { return true; @@ -484,7 +477,6 @@ public class Board { } public Board(Piece[][] board) { - //Piece[][] newBoard = new Piece[lineNum][colNum]; for (int i = 0; i < colNum; i++) { for (int j = 0; j < lineNum; j++) { piece = board[j][i];