dev: Continue to write the chess logic, working through it bit by bit
This commit is contained in:
parent
d6eb6b69c2
commit
ba64e2bcf3
4 changed files with 96 additions and 15 deletions
25
Board.cpp
25
Board.cpp
|
|
@ -13,8 +13,29 @@ Board::Board() {
|
|||
boardGrid.resize(8);
|
||||
for(int i = 0; i < 8; i++) {
|
||||
boardGrid[i].resize(8);
|
||||
for(int j = 0; j < 8; j++) {
|
||||
boardGrid[i][j] = std::make_unique<Piece>(PIECE_EMPTY);
|
||||
switch(i) {
|
||||
case 0:
|
||||
// white back rank
|
||||
break;
|
||||
case 1:
|
||||
// white pawn rank
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
//empty squares
|
||||
for(int j = 0; j <= 8; j++) {
|
||||
boardGrid[i][j] = std::make_unique<Piece>(PIECE_EMPTY);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
// black pawn rank
|
||||
break;
|
||||
case 7:
|
||||
// black back rank
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue