diff options
Diffstat (limited to 'src/board.hpp')
| -rw-r--r-- | src/board.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
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 <cstdint> #include <string> -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); |
