aboutsummaryrefslogtreecommitdiff
path: root/src/board.hpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-28 12:50:36 +0200
committerAdam <adammegarules1@gmail.com>2026-07-28 12:50:36 +0200
commit50be320c33bd942b238e8f82aa34230539878bab (patch)
treed4b98a6a90e49cd29cfdbb8fbf0512e64d907217 /src/board.hpp
parent3109a2516e75072835f1998a9b702003781612d5 (diff)
changes
Diffstat (limited to 'src/board.hpp')
-rw-r--r--src/board.hpp21
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);