diff options
author | ymherklotz <ymherklotz@gmail.com> | 2017-01-14 14:17:26 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2017-01-14 14:17:26 +0000 |
commit | a5bc94a36fe37fb20eba61516da3b6b58208537b (patch) | |
tree | 30ba838ba6ece239c006dfae6db21d085df81832 /src | |
parent | 6fc3dfc10ce0e690b0de9c811e617dc76104db40 (diff) | |
download | ChessAI-a5bc94a36fe37fb20eba61516da3b6b58208537b.tar.gz ChessAI-a5bc94a36fe37fb20eba61516da3b6b58208537b.zip |
added colour to pieces and comments
Diffstat (limited to 'src')
-rw-r--r-- | src/bishop.cpp | 2 | ||||
-rw-r--r-- | src/chess_piece.cpp | 18 | ||||
-rw-r--r-- | src/king.cpp | 2 | ||||
-rw-r--r-- | src/knight.cpp | 2 | ||||
-rw-r--r-- | src/pawn.cpp | 2 | ||||
-rw-r--r-- | src/queen.cpp | 2 | ||||
-rw-r--r-- | src/rook.cpp | 2 |
7 files changed, 20 insertions, 10 deletions
diff --git a/src/bishop.cpp b/src/bishop.cpp index fc87db2..4894be5 100644 --- a/src/bishop.cpp +++ b/src/bishop.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; Bishop::Bishop() : ChessPiece() { } -Bishop::Bishop(const int& x, const int& y) : ChessPiece(x, y) { +Bishop::Bishop(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void Bishop::move(const int& x, const int& y) { diff --git a/src/chess_piece.cpp b/src/chess_piece.cpp index 8d4cb94..ee307e2 100644 --- a/src/chess_piece.cpp +++ b/src/chess_piece.cpp @@ -1,12 +1,22 @@ +/* + * + * author: Yann Herklotz + * username: ymherklotz + * email: ymherklotz@gmail.com + * + * ----------------------------------------------------------------------------- + * + * Chess Piece class implementation + * + */ + #include "chess_piece.hpp" using namespace ymhChessAI; -// Chess Piece Base class that all the pieces inherit from - -ChessPiece::ChessPiece() : m_x(0), m_y(0) { +ChessPiece::ChessPiece() : m_x(0), m_y(0), m_colour(Colour::White) { } -ChessPiece::ChessPiece(const int& x, const int& y) : m_x(x), m_y(y) { +ChessPiece::ChessPiece(const int& x, const int& y, const Colour& colour) : m_x(x), m_y(y), m_colour(colour) { } diff --git a/src/king.cpp b/src/king.cpp index 0f332b7..8e8a6b9 100644 --- a/src/king.cpp +++ b/src/king.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; King::King() : ChessPiece() { } -King::King(const int& x, const int& y) : ChessPiece(x, y) { +King::King(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void King::move(const int& x, const int& y) { diff --git a/src/knight.cpp b/src/knight.cpp index c40921f..5c2a946 100644 --- a/src/knight.cpp +++ b/src/knight.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; Knight::Knight() : ChessPiece() { } -Knight::Knight(const int& x, const int& y) : ChessPiece(x, y) { +Knight::Knight(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void Knight::move(const int& x, const int& y) { diff --git a/src/pawn.cpp b/src/pawn.cpp index c1f172f..e81959f 100644 --- a/src/pawn.cpp +++ b/src/pawn.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; Pawn::Pawn() : ChessPiece() { } -Pawn::Pawn(const int& x, const int& y) : ChessPiece(x, y) { +Pawn::Pawn(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void Pawn::move(const int& x, const int& y) { diff --git a/src/queen.cpp b/src/queen.cpp index d4e7ce0..d685548 100644 --- a/src/queen.cpp +++ b/src/queen.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; Queen::Queen() : ChessPiece() { } -Queen::Queen(const int& x, const int& y) : ChessPiece(x, y) { +Queen::Queen(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void Queen::move(const int& x, const int& y) { diff --git a/src/rook.cpp b/src/rook.cpp index 166e114..cba38a9 100644 --- a/src/rook.cpp +++ b/src/rook.cpp @@ -18,7 +18,7 @@ using namespace ymhChessAI; Rook::Rook() : ChessPiece() { } -Rook::Rook(const int& x, const int& y) : ChessPiece(x, y) { +Rook::Rook(const int& x, const int& y, const Colour& colour) : ChessPiece(x, y, colour) { } void Rook::move(const int& x, const int& y) { |