diff --git a/src/schack/Board.java b/src/schack/Board.java index 013c072..542ab01 100644 --- a/src/schack/Board.java +++ b/src/schack/Board.java @@ -18,8 +18,6 @@ public class Board extends JPanel implements MouseListener { public static final int SIZE_OF_TILE = 100; private Piece[][] pieces = new Piece[8][8]; private ArrayList validMovesToDraw = new ArrayList<>(); - private ArrayList validDebugMovesToDraw = new ArrayList<>(); - private ArrayList validDebugAttacksToDraw = new ArrayList<>(); private Point selectedPiece = new Point(); private Color moveableColor = new Color(255, 191, 0); public static boolean whiteToMove = true; @@ -63,15 +61,6 @@ public class Board extends JPanel implements MouseListener { Graphics2D g2 = (Graphics2D) g; drawSquares(g2); - validDebugMovesToDraw.stream().filter(point -> point != null).forEach(point -> { - g2.setColor(Color.CYAN); - g2.fillRect(point.x * SIZE_OF_TILE, point.y * SIZE_OF_TILE, SIZE_OF_TILE/2, SIZE_OF_TILE); - }); - - validDebugAttacksToDraw.stream().filter(point -> point != null).forEach(point -> { - g2.setColor(Color.RED); - g2.fillRect(point.x * SIZE_OF_TILE, point.y * SIZE_OF_TILE, SIZE_OF_TILE, SIZE_OF_TILE/2); - }); // måla alla ställen man kan gå¨till validMovesToDraw.stream().filter(point -> point != null) .forEach(point -> { @@ -137,12 +126,7 @@ public class Board extends JPanel implements MouseListener { ArrayList opposingAttacks = checkAttacks(!whiteToMove); - // opposingAttacks.removeAll(allValidMoves); - - validDebugMovesToDraw = allValidMoves; - validDebugAttacksToDraw = opposingAttacks; boolean weCanMove = allValidMoves.size() > 0; - boolean hasShowedMessageAboutSchack = false; for (Point attack : opposingAttacks) { @@ -187,7 +171,6 @@ public class Board extends JPanel implements MouseListener { ArrayList validMoves = selectedPiece.validMoves(pieces, true); // Kolla ifall vi kan röra oss // Loopa igenom allt - System.out.println("\n\n\n\n\n\n"); ArrayList allValidMoves = new ArrayList<>(); for (Piece[] pieceArr : pieces) { diff --git a/src/schack/Pawn.java b/src/schack/Pawn.java index be69717..e82588f 100644 --- a/src/schack/Pawn.java +++ b/src/schack/Pawn.java @@ -42,7 +42,6 @@ public class Pawn extends PieceKnownIfMoved { Point pos = new Point(this.position.x, this.position.y + (this.isWhite ? -pawnDY : pawnDY)); boolean shouldBreak = addMovesIfCan(pos, movable, pieces, isSelected); if (shouldBreak) { - System.out.println("should brkje!"); break; } } @@ -53,7 +52,6 @@ public class Pawn extends PieceKnownIfMoved { Point pos = new Point(this.position.x + pawnX, this.position.y + (this.isWhite ? -1 : 1)); addAttackMovesIfCan(pos, movable, pieces); } - System.out.println("len of movable: " + movable.size()); return movable; }