aboutsummaryrefslogtreecommitdiff
path: root/src/moves.hpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-15 17:01:54 +0200
committerAdam <adammegarules1@gmail.com>2026-08-15 17:01:54 +0200
commit4eb36e67eca586a662298bfe8cc5392fbfa698e0 (patch)
tree6c232d59d1566377fbaeec035f4f799618f63421 /src/moves.hpp
parentc1d6113da12bfbe92ae718d93dd56e25556e52cb (diff)
implementing memory optimazied move using uint16_t instead of a four integers and one byte
Diffstat (limited to 'src/moves.hpp')
-rw-r--r--src/moves.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/moves.hpp b/src/moves.hpp
index 57d1467..54ab730 100644
--- a/src/moves.hpp
+++ b/src/moves.hpp
@@ -2,20 +2,22 @@
#define SRC_MOVES_H_
#include "board/board.hpp"
+#include <cstdint>
#include <vector>
-std::vector<Move> GetLegalMoves(Game *g, bool GenerateQuietMoves = true);
-std::vector<Move> GetPseudoLegalMoves(Game *g, bool GenerateQuietMoves);
+std::vector<uint16_t> GetLegalMoves(Game *g, bool GenerateQuietMoves = true);
+std::vector<uint16_t> GetPseudoLegalMoves(Game *g, bool GenerateQuietMoves);
Position IndexToPosition(int i);
void GenerateSlidingMoves(Game *g, int from,
const std::array<int, 4> &directions,
- std::vector<Move> &moves, bool GenerateQuietMoves);
-void GenerateKingMoves(Game *g, int from, std::vector<Move> &moves,
+ std::vector<uint16_t> &moves,
+ bool GenerateQuietMoves);
+void GenerateKingMoves(Game *g, int from, std::vector<uint16_t> &moves,
bool GenerateQuietMoves);
-void GeneratePawnMoves(Game *b, int from, std::vector<Move> &moves,
+void GeneratePawnMoves(Game *b, 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<Move> &moves);
+void GenerateCastlingMoves(int from, Game *g, std::vector<uint16_t> &moves);
GameState GetNewGameState(Game *g);
#endif /* SRC_MOVES_H_ */