mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
Fixa till streams
This commit is contained in:
parent
6afee98235
commit
debb4ce35f
@ -62,26 +62,21 @@ 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, SIZE_OF_TILE);
|
||||
});
|
||||
|
||||
// måla alla ställen man kan gå¨till
|
||||
validMovesToDraw.forEach(point -> {
|
||||
if (point != null) {
|
||||
validMovesToDraw.stream().filter(point -> point != null)
|
||||
.forEach(point -> {
|
||||
g2.setColor(moveableColor);
|
||||
g2.fillOval(point.x * SIZE_OF_TILE, point.y * SIZE_OF_TILE, SIZE_OF_TILE, SIZE_OF_TILE);
|
||||
}
|
||||
});
|
||||
|
||||
// Draw piece
|
||||
Arrays.stream(pieces).forEach(pieceArr -> Arrays.stream(pieceArr).forEach(piece -> {
|
||||
if (piece != null) {
|
||||
piece.draw(g2);
|
||||
}
|
||||
}));
|
||||
Arrays.stream(pieces).forEach(pieceArr -> Arrays.stream(pieceArr)
|
||||
.filter(piece -> piece != null)
|
||||
.forEach(piece -> piece.draw(g2)));
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user