summaryrefslogtreecommitdiff
path: root/Games/Chess/ChessWidget.h
diff options
context:
space:
mode:
authorPeter Elliott <pelliott@ualberta.ca>2020-08-11 14:10:39 -0600
committerAndreas Kling <kling@serenityos.org>2020-08-15 20:54:02 +0200
commitf2c1782d86b831b03624ff7158b91a97b6a6fc4a (patch)
tree70ce2e699254db42ccd3fc842f3bcf7bea12e510 /Games/Chess/ChessWidget.h
parente05372cee2ccbb63a9754799740439af103e09dc (diff)
downloadserenity-f2c1782d86b831b03624ff7158b91a97b6a6fc4a.zip
Chess: Add win/draw conditions, and display them.
Diffstat (limited to 'Games/Chess/ChessWidget.h')
-rw-r--r--Games/Chess/ChessWidget.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Games/Chess/ChessWidget.h b/Games/Chess/ChessWidget.h
index 0cd06dd82c..f5ad69b017 100644
--- a/Games/Chess/ChessWidget.h
+++ b/Games/Chess/ChessWidget.h
@@ -56,6 +56,9 @@ public:
Chess::Square mouse_to_square(GUI::MouseEvent& event) const;
+ bool drag_enabled() const { return m_drag_enabled; }
+ void set_drag_enabled(bool e) { m_drag_enabled = e; }
+
private:
Chess m_board;
Color m_dark_square_color { Color::from_rgb(0xb58863) };
@@ -66,4 +69,5 @@ private:
Chess::Square m_moving_square { 50, 50 };
Gfx::IntPoint m_drag_point;
bool m_dragging_piece { false };
+ bool m_drag_enabled { true };
};