diff options
author | ymherklotz <ymherklotz@gmail.com> | 2017-01-15 19:44:15 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2017-01-15 19:44:15 +0000 |
commit | 1f138d96ab7f517e7842710ef3428f67a2965877 (patch) | |
tree | 4070a934b4cf8d3040e48a50dc5e0991058fa136 /src/chess_board.cpp | |
parent | a5bc94a36fe37fb20eba61516da3b6b58208537b (diff) | |
download | ChessAI-1f138d96ab7f517e7842710ef3428f67a2965877.tar.gz ChessAI-1f138d96ab7f517e7842710ef3428f67a2965877.zip |
creating the board
Diffstat (limited to 'src/chess_board.cpp')
-rw-r--r-- | src/chess_board.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/chess_board.cpp b/src/chess_board.cpp new file mode 100644 index 0000000..30c8aff --- /dev/null +++ b/src/chess_board.cpp @@ -0,0 +1,34 @@ +/* + * + * author: Yann Herklotz + * username: ymherklotz + * email: ymherklotz@gmail.com + * date created: 14/01/17 + * + * ----------------------------------------------------------------------------- + * + * Chess Board class implementation + * + */ + +#include "chess_board.hpp" +#include <iostream> +using namespace ymhChessAI; + + +ChessBoard::ChessBoard() { + board.reserve(CHESS_BOARD_SIZE); + + for(auto&& piece : board) + piece = std::unique_ptr<ChessPiece>(new King); + + // for(unsigned i = 0; i < CHESS_BOARD_SIZE; ++i) + // board.emplace_back(new King); +} + +void ChessBoard::printBoard() { + for(auto&& piece : board) { + piece->move(1, 2); + std::cout << "Hello" << std::endl; + } +} |