aboutsummaryrefslogtreecommitdiff
path: root/src/board.hpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-27 09:45:58 +0200
committerAdam <adammegarules1@gmail.com>2026-07-27 09:45:58 +0200
commit9b1665430fd0379db92000740c7a70045baa1746 (patch)
tree728993a22f9610a1299c0ef1dd27a63a292b3fc3 /src/board.hpp
parent94cc9240eabf78cbbc9006cb70ca74b6bc3f54e6 (diff)
lot of changes
Diffstat (limited to 'src/board.hpp')
-rw-r--r--src/board.hpp16
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);