1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:37:45 +00:00

Solitaire: Prevent player dragging entire stack to foundation

Currently, it is possible for the player to drag an entire stack
of cards to the foundation stack, provided the top card of the stack
(i.e the "root" card) can be dropped onto the foundation stack.
This causes an invalid state where, e.g, red cards end up in a
black foundation stack, or vice versa.
This commit is contained in:
Jesse Buhagiar 2021-05-18 21:43:02 +10:00 committed by Andreas Kling
parent a743075b9f
commit 2f49241296
3 changed files with 6 additions and 3 deletions

View file

@ -42,7 +42,7 @@ public:
void move_to_stack(CardStack&);
void rebound_cards();
bool is_allowed_to_push(const Card&) const;
bool is_allowed_to_push(const Card&, size_t stack_size = 1) const;
void add_all_grabbed_cards(const Gfx::IntPoint& click_location, NonnullRefPtrVector<Card>& grabbed);
void draw(GUI::Painter&, const Gfx::Color& background_color);
void clear();