#ifndef SRC_BOARD_H_ #define SRC_BOARD_H_ #include #include enum PieceType { NONE, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, }; enum GameState { TURN, WHITE_WON, BLACK_WON, STALEMATE, DRAW, }; char toChar(PieceType type); struct Piece { bool color; PieceType type; bool moved; }; struct Board { Piece pieces[64]; bool turn; // 1 white; 0 black std::string castle; uint8_t halfMoveClock; uint16_t MoveClock; GameState state; }; struct Position { uint8_t rank; uint8_t file; bool operator==(const Position &) const = default; }; struct Move { Position From; Position To; bool operator==(const Move &) const = default; }; void printBoard(Board *b); Piece createPiece(PieceType type, bool color, bool moved = false); void PlayMove(Move move, Board *b); int PositionToIndex(Position i); #endif /* SRC_BOARD_H_ */