diff options
| author | Adam <adammegarules1@gmail.com> | 2026-08-17 15:22:37 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-08-17 15:22:37 +0200 |
| commit | ad04f16e478357633c08174e844c8756f7892a32 (patch) | |
| tree | 6e1ca98dfa67584e86346bfe36c5d98ff6d59b3c /src/moves.hpp | |
| parent | 26c0c08b1c4fb302db55355bd49181c8740b7ee6 (diff) | |
refactor(board): refactoring move generation code into better and nice way + adding debug command moves
Diffstat (limited to 'src/moves.hpp')
| -rw-r--r-- | src/moves.hpp | 23 |
1 files changed, 11 insertions, 12 deletions
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 <cstdint> #include <vector> -std::vector<uint16_t> GetLegalMoves(Game *g, bool GenerateQuietMoves = true); -std::vector<uint16_t> GetPseudoLegalMoves(Game *g, bool GenerateQuietMoves); +enum move_generate_options : std::uint8_t { + ALL, + CAPTUARES_ONLY, + NON_CAPTUARES_ONLY, +}; + +std::vector<uint16_t> GetLegalMoves(Game *g, + const move_generate_options &options); +std::vector<uint16_t> GetPseudoLegalMoves(const Game &g, + const move_generate_options &options); Position IndexToPosition(int i); -void GenerateSlidingMoves(Game *g, int from, - const std::array<int, 4> &directions, - std::vector<uint16_t> &moves, - bool GenerateQuietMoves); -void GenerateKingMoves(Game *g, int from, std::vector<uint16_t> &moves, - bool GenerateQuietMoves); -void GeneratePawnMoves(const Game &g, uint8_t from, - std::vector<uint16_t> &moves, bool GenerateQuietMoves); -bool IsSquareAttacked(Game *g, Position square, bool byColor); -void GenerateCastlingMoves(int from, Game *g, std::vector<uint16_t> &moves); +bool IsSquareAttacked(const Game &g, Position square, bool byColor); GameState GetNewGameState(Game *g); #endif /* SRC_MOVES_H_ */ |
