From ad04f16e478357633c08174e844c8756f7892a32 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 17 Aug 2026 15:22:37 +0200 Subject: refactor(board): refactoring move generation code into better and nice way + adding debug command moves --- src/moves.hpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/moves.hpp') diff --git a/src/moves.hpp b/src/moves.hpp index c7ce5e3..e0ed427 100644 --- a/src/moves.hpp +++ b/src/moves.hpp @@ -5,19 +5,18 @@ #include #include -std::vector GetLegalMoves(Game *g, bool GenerateQuietMoves = true); -std::vector GetPseudoLegalMoves(Game *g, bool GenerateQuietMoves); +enum move_generate_options : std::uint8_t { + ALL, + CAPTUARES_ONLY, + NON_CAPTUARES_ONLY, +}; + +std::vector GetLegalMoves(Game *g, + const move_generate_options &options); +std::vector GetPseudoLegalMoves(const Game &g, + const move_generate_options &options); Position IndexToPosition(int i); -void GenerateSlidingMoves(Game *g, int from, - const std::array &directions, - std::vector &moves, - bool GenerateQuietMoves); -void GenerateKingMoves(Game *g, int from, std::vector &moves, - bool GenerateQuietMoves); -void GeneratePawnMoves(const Game &g, uint8_t from, - std::vector &moves, bool GenerateQuietMoves); -bool IsSquareAttacked(Game *g, Position square, bool byColor); -void GenerateCastlingMoves(int from, Game *g, std::vector &moves); +bool IsSquareAttacked(const Game &g, Position square, bool byColor); GameState GetNewGameState(Game *g); #endif /* SRC_MOVES_H_ */ -- cgit v1.2.3