mirror of
https://github.com/lov3b/Schack.git
synced 2024-11-13 00:20:10 +01:00
ta bort developer-move
This commit is contained in:
parent
3a9d90ed0d
commit
0ef41665d1
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,6 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
private ArrayList<Point> validMovesToDraw = new ArrayList<>();
|
private ArrayList<Point> validMovesToDraw = new ArrayList<>();
|
||||||
private Point selectedPiece = new Point();
|
private Point selectedPiece = new Point();
|
||||||
private final Color moveableColor = new Color(255, 191, 0);
|
private final Color moveableColor = new Color(255, 191, 0);
|
||||||
public boolean developerMode = false;
|
|
||||||
short turnCount = 0;
|
short turnCount = 0;
|
||||||
private boolean whitesTurn = true;
|
private boolean whitesTurn = true;
|
||||||
|
|
||||||
@ -181,7 +180,7 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
final Piece selectedPiece = pieces[mouseCoordinateX][mouseCoordinateY];
|
final Piece selectedPiece = pieces[mouseCoordinateX][mouseCoordinateY];
|
||||||
|
|
||||||
// Kolla endast ifall vi kan röra på pjäsen om det är samma färg som den tur vi är på
|
// Kolla endast ifall vi kan röra på pjäsen om det är samma färg som den tur vi är på
|
||||||
if (selectedPiece.isWhite() == whitesTurn || developerMode) {
|
if (selectedPiece.isWhite() == whitesTurn) {
|
||||||
ArrayList<Point> attacks = checkAttacks(whitesTurn);
|
ArrayList<Point> attacks = checkAttacks(whitesTurn);
|
||||||
|
|
||||||
ArrayList<Point> validMoves = selectedPiece.validMoves(pieces, true);
|
ArrayList<Point> validMoves = selectedPiece.validMoves(pieces, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user