int main() { GameBoard chessBoard(8, 8); ChessPiece pawn; chessBoard.setPieceAt(0, 0, &pawn); chessBoard.setPieceAt(0, 1, chessBoard.getPieceAt(0, 0)); GameBoard board2; board2 = chessBoard; processGameBoard(board2); return 0; }
int main() { GameBoard chessBoard(8, 8); auto pawn = std::make_unique<ChessPiece>(); chessBoard.at(0, 0) = std::move(pawn); chessBoard.at(0, 1) = std::make_unique<ChessPiece>(); chessBoard.at(0, 1) = nullptr; GameBoard board2; board2 = chessBoard; processGameBoard(board2); return 0; }
int main() { GameBoard board(10, 10); GamePiece piece; board.setPieceAt(0, 0, piece); board.setPieceAt(0, 1, board.getPieceAt(0, 0)); GameBoard board2; board2 = board; processGameBoard(board2); return 0; }