From 9b1665430fd0379db92000740c7a70045baa1746 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 27 Jul 2026 09:45:58 +0200 Subject: lot of changes --- src/board.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/board.hpp') diff --git a/src/board.hpp b/src/board.hpp index 9e80025..05706ff 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -3,7 +3,7 @@ #include #include -enum pieceType { +enum PieceType { NONE, PAWN, KNIGHT, @@ -13,11 +13,18 @@ enum pieceType { KING, }; -char toChar(pieceType type); +enum GameState { + TURN, + WHITE_WON, + BLACK_WON, + STALEMATE, + DRAW, +}; +char toChar(PieceType type); struct Piece { bool color; - pieceType type; + PieceType type; bool moved; }; @@ -27,6 +34,7 @@ struct Board { std::string castle; uint8_t halfMoveClock; uint16_t MoveClock; + GameState state; }; struct Position { @@ -43,7 +51,7 @@ struct Move { bool operator==(const Move &) const = default; }; void printBoard(Board *b); -Piece createPiece(pieceType type, bool color, bool moved = false); +Piece createPiece(PieceType type, bool color, bool moved = false); void PlayMove(Move move, Board *b); int PositionToIndex(Position i); -- cgit v1.2.3