diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-28 12:50:36 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-28 12:50:36 +0200 |
| commit | 50be320c33bd942b238e8f82aa34230539878bab (patch) | |
| tree | d4b98a6a90e49cd29cfdbb8fbf0512e64d907217 /src/board.hpp | |
| parent | 3109a2516e75072835f1998a9b702003781612d5 (diff) | |
changes
Diffstat (limited to 'src/board.hpp')
| -rw-r--r-- | src/board.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/board.hpp b/src/board.hpp index 592b438..e9e3570 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -52,7 +52,26 @@ struct Move { Position From; Position To; - bool operator==(const Move &) const = default; + PieceType promotion = NONE; + bool operator==(const Move &other) const { + return From == other.From && To == other.To && promotion == other.promotion; + } +}; +struct UndoMove { + Piece movedPiece; + Piece capturedPiece; + + Position from; + Position to; + + bool oldTurn; + bool oldCanEnpassant; + Position oldEnPassant; + std::string oldCaslte; + int oldHalfMoveClock; + int oldMoveClock; + std::unordered_map<uint64_t, int> OldThreeFoldMap; + GameState oldState; }; void printBoard(Game *b); Piece createPiece(PieceType type, bool color, bool moved = false); |
