blob: e0967ad4e8c530044dccc066528e329f4f835663 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
*
* author: Yann Herklotz
* username: ymherklotz
* email: ymherklotz@gmail.com
* date created: 14/01/17
*
* -----------------------------------------------------------------------------
*
* Chess Board class implementation
*
*/
#include "chess_board.hpp"
#include "chess_constants.hpp"
#include <iostream>
using namespace ymhChessAI;
ChessBoard::ChessBoard() {
for(unsigned i = 0; i < ChessConstants::BOARD_SIZE; ++i)
board.emplace_back(new EmptyPiece);
}
bool ChessBoard::populateBoard() {
for(auto && piece : board)
piece = chessPiecePtr(new Knight);
return true;
}
bool ChessBoard::printBoard() {
int i = 0;
for(auto && piece : board) {
std::cout << i << " ";
piece->move(1, 2);
++i;
}
return true;
}
|