cleanBoard corrected
This commit is contained in:
parent
0013c62fe9
commit
cafec37e4c
|
|
@ -6,3 +6,4 @@ BP,BP,BP,BP,BP,BP,BP,BP
|
||||||
,,,,,,,
|
,,,,,,,
|
||||||
WP,WP,WP,WP,WP,WP,WP,WP
|
WP,WP,WP,WP,WP,WP,WP,WP
|
||||||
WR,WN,WB,WQ,WK,WB,WN,WR
|
WR,WN,WB,WQ,WK,WB,WN,WR
|
||||||
|
W
|
||||||
|
|
@ -102,7 +102,9 @@ public class Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanBoard() {
|
public void cleanBoard() {
|
||||||
pieces.clear(); // Remove all pieces from the board
|
pieces.clear();
|
||||||
|
turnNumber = 0;
|
||||||
|
isWhiteTurn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,5 @@
|
||||||
package backend;
|
package backend;
|
||||||
|
|
||||||
public class Move {
|
public class Move {
|
||||||
private Piece movedPiece;
|
|
||||||
private int fromX, fromY;
|
|
||||||
private int toX, toY;
|
|
||||||
private Piece capturedPiece;
|
|
||||||
private int capturedX, capturedY;
|
|
||||||
private int pieceMoveCountBefore;
|
|
||||||
private int boardTurnNumberBefore;
|
|
||||||
private boolean isWhiteTurnBefore;
|
|
||||||
|
|
||||||
public Move(
|
|
||||||
Piece movedPiece, int fromX, int fromY, int toX, int toY,
|
|
||||||
Piece capturedPiece, int capturedX, int capturedY,
|
|
||||||
int pieceMoveCountBefore, int boardTurnNumberBefore, boolean isWhiteTurnBefore
|
|
||||||
) {
|
|
||||||
this.movedPiece = movedPiece;
|
|
||||||
this.fromX = fromX;
|
|
||||||
this.fromY = fromY;
|
|
||||||
this.toX = toX;
|
|
||||||
this.toY = toY;
|
|
||||||
this.capturedPiece = capturedPiece;
|
|
||||||
this.capturedX = capturedX;
|
|
||||||
this.capturedY = capturedY;
|
|
||||||
this.pieceMoveCountBefore = pieceMoveCountBefore;
|
|
||||||
this.boardTurnNumberBefore = boardTurnNumberBefore;
|
|
||||||
this.isWhiteTurnBefore = isWhiteTurnBefore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Piece getMovedPiece() { return movedPiece; }
|
|
||||||
public int getFromX() { return fromX; }
|
|
||||||
public int getFromY() { return fromY; }
|
|
||||||
public Piece getCapturedPiece() { return capturedPiece; }
|
|
||||||
public int getCapturedX() { return capturedX; }
|
|
||||||
public int getCapturedY() { return capturedY; }
|
|
||||||
public int getPieceMoveCountBefore() { return pieceMoveCountBefore; }
|
|
||||||
public int getBoardTurnNumberBefore() { return boardTurnNumberBefore; }
|
|
||||||
public boolean isWhiteTurnBefore() { return isWhiteTurnBefore; }
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue