From e9d328acf4ee45bd8771d422fa4db40298e6e16a Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sat, 29 Jan 2022 11:52:47 +0100 Subject: Init project --- src/ChessArbiter.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/ChessArbiter.hpp (limited to 'src/ChessArbiter.hpp') diff --git a/src/ChessArbiter.hpp b/src/ChessArbiter.hpp new file mode 100644 index 0000000..5739904 --- /dev/null +++ b/src/ChessArbiter.hpp @@ -0,0 +1,40 @@ +#include "Board.hpp" +#include "Fen.hpp" +#include + +namespace chessarbiter { +class ChessArbiter { + Board board; + FEN fen; + FEN fen_last; // To undo a move + int wPawn, wRook, wKnight, wBishop, wQueen, wKing; + +public: + ChessArbiter(); + void Setup(std::string); + void SetFEN(std::string); + void SetFEN(FEN); + std::string GetFEN(); + /// @brief Check which player is going to play + bool IsBlackTurn(); + /// @brief Check if a side is in check + bool IsCheck(bool); + /// @brief Play a move (return false if it's illegal) + bool Play(std::string); + /// @brief Check if a square is attacked by a particular player + bool IsAttacked(std::string, bool); + /// @brief Get the serialized board + std::string GetBoard(); + /// @brief Get current position evaluation according to player's material + int GetMaterialScore(); + /// @brief Check if position is legal + bool IsPlayable(); + /// @brief Get pieces captures by a player + std::string GetCaptures(bool); + /// @brief List all the legal moves of a player + std::vector ListLegalMoves(bool); + /// @brief Check if a specific castle is possible by a player + bool IsCastlePossible(bool, bool); + bool IsCheckMate(); +}; +} // namespace chessarbiter \ No newline at end of file -- cgit v1.2.3