From 9025383477acf5f9a6360877c502232eaec24e02 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 7 Mar 2022 11:30:55 +0100 Subject: Add WasEnPassant() method for convenience --- src/ChessArbiter.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ChessArbiter.hpp') diff --git a/src/ChessArbiter.hpp b/src/ChessArbiter.hpp index e012b4a..19a4ba1 100644 --- a/src/ChessArbiter.hpp +++ b/src/ChessArbiter.hpp @@ -10,14 +10,16 @@ if (positions.find(fen.board) != positions.end()) \ positions_backup = positions[fen.board]; \ std::string SAN_backup = SAN; \ - char capture_backup = capture; + char capture_backup = capture; \ + bool was_enpassant_backup = was_enpassant; #define RESTORE_BACKUP() \ SetFEN(fen_backup); \ if (positions_backup != 0) \ positions[fen.board] = positions_backup; \ SAN = SAN_backup; \ - capture = capture_backup; + capture = capture_backup; \ + was_enpassant = was_enpassant_backup; namespace chessarbiter { class ChessArbiter { @@ -31,6 +33,7 @@ class ChessArbiter { void SetFEN(FEN); std::string SAN, SAN_last; char capture; + bool was_enpassant; public: ChessArbiter(); @@ -65,6 +68,7 @@ public: bool IsDrawByNoMoves(); bool IsDrawByRepetitions(); bool IsDraw(); + bool WasEnPassant(); std::string ParseSAN(std::string SANMove); }; } // namespace chessarbiter -- cgit v1.2.3