This commit is contained in:
MSI 2025-05-06 16:18:06 +02:00
parent d4de2f66b2
commit 66b6416e6f
1 changed files with 14 additions and 2 deletions

View File

@ -267,10 +267,22 @@ public class Board {
}
public Board(Board board) {
//TODO
public Board(Board other) {
this.cNum = other.cNum;
this.lNum = other.lNum;
this.cells = new Piece[cNum][lNum];
this.selectedCell = null; // don't copy selection
for (int x = 0; x < cNum; x++) {
for (int y = 0; y < lNum; y++) {
Piece p = other.cells[x][y];
if (p != null) {
this.cells[x][y] = new Piece(p.getType(), p.isWhite(), x, y);
}
}
}
}
public void playMove(Move move) {
//TODO