summaryrefslogtreecommitdiff
path: root/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'board.h')
-rw-r--r--board.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/board.h b/board.h
index eb50917..6b17d53 100644
--- a/board.h
+++ b/board.h
@@ -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);
};