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/board | |
| parent | 26c0c08b1c4fb302db55355bd49181c8740b7ee6 (diff) | |
refactor(board): refactoring move generation code into better and nice way + adding debug command moves
Diffstat (limited to 'src/board')
| -rw-r--r-- | src/board/board.cpp | 4 | ||||
| -rw-r--r-- | src/board/board.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/board/board.cpp b/src/board/board.cpp index 09c7a25..9ac60a8 100644 --- a/src/board/board.cpp +++ b/src/board/board.cpp @@ -87,8 +87,8 @@ PieceType getPromotionTypeFromMove(uint16_t move) { uint8_t getFromValueFromMove(uint16_t move) { return (move >> 2) & 63; }; uint8_t getToValueFromMove(uint16_t move) { return (move >> 8) & 63; }; -Position FindKing(Game *g, bool color) { - return IndexToPosition(__builtin_ctzll(g->PieceBitboards[color][KING])); +Position FindKing(const Game &g, bool color) { + return IndexToPosition(__builtin_ctzll(g.PieceBitboards[color][KING])); } bool isRepetionDraw(uint64_t key, Game *g) { diff --git a/src/board/board.hpp b/src/board/board.hpp index e3692f6..a2c4e1f 100644 --- a/src/board/board.hpp +++ b/src/board/board.hpp @@ -108,6 +108,6 @@ int PositionToIndex(Position i); Undo MakeMove(uint16_t move, Game *g); void UndoMove(Undo undo, Game *g); -Position FindKing(Game *g, bool color); +Position FindKing(const Game &g, bool color); void UpdateHelpers(Game *g); #endif /* SRC_BOARD_H_ */ |
