From 48fd630204f1d49781fbbe72a367b0737ebb29f2 Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Wed, 21 Dec 2022 08:48:53 +0100 Subject: [PATCH] [Board] Implement turn --- Board.cpp | 4 ++-- Board.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Board.cpp b/Board.cpp index 64e8d04..8320e39 100644 --- a/Board.cpp +++ b/Board.cpp @@ -33,11 +33,11 @@ Piece::Optional Board::piece(const Square &square) const { } void Board::setTurn(PieceColor turn) { - (void) turn; + mTurn = turn; } PieceColor Board::turn() const { - return PieceColor::White; + return mTurn; } void Board::setCastlingRights(CastlingRights cr) { diff --git a/Board.hpp b/Board.hpp index af76040..36aadff 100644 --- a/Board.hpp +++ b/Board.hpp @@ -39,6 +39,7 @@ public: private: BitBoard mPieceBBs[BB_NUM] = {}; + PieceColor mTurn = PieceColor::White; static inline void clearIndex(BitBoard &b, unsigned int i) { b &= ~(1ULL << i);