Board
This commit is contained in:
parent
d4de2f66b2
commit
66b6416e6f
|
|
@ -267,10 +267,22 @@ public class Board {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Board(Board board) {
|
public Board(Board other) {
|
||||||
//TODO
|
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) {
|
public void playMove(Move move) {
|
||||||
//TODO
|
//TODO
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue