diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-29 20:16:13 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-29 20:16:13 +0200 |
| commit | 53e58af35c46140a05b3ce4dcec9e425ca359529 (patch) | |
| tree | d4531fddfbcfaa50d920a5598ade3ec535de8340 /src/board.hpp | |
| parent | d528a20684570fb70f0e6b13a78bc6504a1edd89 (diff) | |
new folder structer
Diffstat (limited to 'src/board.hpp')
| -rw-r--r-- | src/board.hpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/src/board.hpp b/src/board.hpp deleted file mode 100644 index 7d0cb3f..0000000 --- a/src/board.hpp +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef SRC_BOARD_H_ -#define SRC_BOARD_H_ - -#include <cstdint> -#include <unordered_map> - -enum PieceType { - NONEPIECE, - PAWN, - KNIGHT, - BISHOP, - ROOK, - QUEEN, - KING, -}; - -enum GameState { - TURN, - WHITE_WON, - BLACK_WON, - STALEMATE, - DRAW, -}; - -struct Piece { - bool color = 0; - PieceType type = NONEPIECE; -}; - -struct Position { - uint8_t rank = 0; - uint8_t file = 0; - - bool operator==(const Position &) const = default; -}; -struct TranspositionsEntry { - int depth; - float Eval; -}; -struct Game { - Piece pieces[64]; - bool turn = 1; // 1 white; 0 black - bool whiteCastleKing = false; - bool whiteCastleQueen = false; - bool blackCastleKing = false; - bool blackCastleQueen = false; - uint8_t halfMoveClock = 0; - uint16_t MoveClock = 0; - Position enPassant; - bool canEnpassant = 0; - GameState state = TURN; - std::unordered_map<uint64_t, int> ThreeFoldMap; - std::unordered_map<uint64_t, TranspositionsEntry> *Transpositions = nullptr; -}; - -struct Move { - Position From; - Position To; - - PieceType promotion = NONEPIECE; - bool operator==(const Move &other) const { - return From == other.From && To == other.To && promotion == other.promotion; - } -}; -struct UndoMove { - Piece movedPiece; - Piece capturedPiece; - - Position from; - Position to; - - bool wasEnPassantCapture = false; - Position enPassantCapturedSquare; - Piece enPassantCapturedPiece; - - bool oldTurn; - bool oldCanEnpassant; - Position oldEnPassant; - - bool OldwhiteCastleKing; - bool OldwhiteCastleQueen; - bool OldblackCastleKing; - bool OldblackCastleQueen; - - int oldHalfMoveClock; - int oldMoveClock; - uint64_t zobristKey; - GameState oldState; - - // castling - bool wasCastle = false; - bool CastledSide = false; // 0 for queen side, 1 for king side -}; -Piece createPiece(PieceType type, bool color); - -int PositionToIndex(Position i); -UndoMove MakeMove(Move move, Game *g); -void UnMakeMove(UndoMove undo, Game *g); - -Position FindKing(Game *b, bool white); -#endif /* SRC_BOARD_H_ */ |
