mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
sout be gone
This commit is contained in:
parent
f070ae87a4
commit
8a72456334
@ -172,50 +172,33 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
|
|
||||||
// Ifall vi har tryckt på en pjäs och sedan ska gå dit
|
// Ifall vi har tryckt på en pjäs och sedan ska gå dit
|
||||||
if (validMovesToDraw.contains(clicked)) {
|
if (validMovesToDraw.contains(clicked)) {
|
||||||
|
|
||||||
System.out.println("1");
|
|
||||||
try {
|
try {
|
||||||
Piece p = pieces[selectedPiece.x][selectedPiece.y];
|
Piece p = pieces[selectedPiece.x][selectedPiece.y];
|
||||||
System.out.println("2");
|
|
||||||
p.move(pieces, clicked, selectedPiece);
|
p.move(pieces, clicked, selectedPiece);
|
||||||
System.out.println("3");
|
|
||||||
|
|
||||||
System.out.println("4");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
validMovesToDraw.clear();
|
validMovesToDraw.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println("5");
|
|
||||||
selectedPiece = new Point(clicked);
|
selectedPiece = new Point(clicked);
|
||||||
System.out.println("6");
|
|
||||||
validMovesToDraw.clear();
|
validMovesToDraw.clear();
|
||||||
System.out.println("7");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("X: " + mouseCoordinateX + ", Y: " + mouseCoordinateY);
|
System.out.println("X: " + mouseCoordinateX + ", Y: " + mouseCoordinateY);
|
||||||
if (!validMovesToDraw.contains(clicked)) {
|
if (!validMovesToDraw.contains(clicked)) {
|
||||||
System.out.println("8");
|
|
||||||
try {
|
try {
|
||||||
Piece p = pieces[mouseCoordinateX][mouseCoordinateY];
|
Piece p = pieces[mouseCoordinateX][mouseCoordinateY];
|
||||||
System.out.println("9");
|
|
||||||
LinkedHashSet validMoves = p.validMoves(pieces);
|
LinkedHashSet validMoves = p.validMoves(pieces);
|
||||||
System.out.println("10");
|
|
||||||
validMovesToDraw.addAll(validMoves);
|
validMovesToDraw.addAll(validMoves);
|
||||||
System.out.println("11");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("12");
|
|
||||||
validMovesToDraw.clear();
|
validMovesToDraw.clear();
|
||||||
System.out.println("13");
|
|
||||||
}
|
}
|
||||||
} else{
|
} else {
|
||||||
validMovesToDraw.clear();
|
validMovesToDraw.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user