diff options
Diffstat (limited to 'src/board.hpp')
| -rw-r--r-- | src/board.hpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/board.hpp b/src/board.hpp index 4f04783..2e8cb82 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -2,7 +2,6 @@ #define SRC_BOARD_H_ #include <cstdint> -#include <string> #include <unordered_map> enum PieceType { @@ -26,7 +25,6 @@ enum GameState { struct Piece { bool color = 0; PieceType type = NONEPIECE; - bool moved = false; }; struct Position { @@ -42,7 +40,10 @@ struct TranspositionsEntry { struct Game { Piece pieces[64]; bool turn = 1; // 1 white; 0 black - std::string castle = ""; + bool whiteCastleKing = false; + bool whiteCastleQueen = false; + bool blackCastleKing = false; + bool blackCastleQueen = false; uint8_t halfMoveClock = 0; uint16_t MoveClock = 0; Position enPassant; @@ -75,13 +76,22 @@ struct UndoMove { bool oldTurn; bool oldCanEnpassant; Position oldEnPassant; - std::string oldCaslte; + + bool OldwhiteCastleKing; + bool OldwhiteCastleQueen; + bool OldblackCastleKing; + bool OldblackCastleQueen; + int oldHalfMoveClock; int oldMoveClock; uint64_t zobristKey; GameState oldState; + + // castling + bool wasCastle = false; + bool CastledSide = false; // 0 for queen side, 1 for king side }; -Piece createPiece(PieceType type, bool color, bool moved = false); +Piece createPiece(PieceType type, bool color); int PositionToIndex(Position i); UndoMove MakeMove(Move move, Game *g); |
