diff options
Diffstat (limited to 'board.h')
-rw-r--r-- | board.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -17,6 +17,10 @@ const int EMPTY = 0, PAWN = 1, ROOK = 2, KNIGHT = 3, BISHOP = 4, KING = 5, QUEEN // ... // WHITE WHITE WHITE y = 7 +enum class CheckResult { + safe, check, checkmate, stalemate +}; + #define IDX(x_, y_) (8 * (y_) + (x_)) @@ -59,6 +63,10 @@ public: bool isValid(const Move &mv) const; // SLOW + // SLOW; Only detects anything for the given player. + // Assumes no king has been taken yet. + CheckResult checkCheck(int player) const; + friend bool operator==(const Board &B1, const Board &B2); }; |