diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-09-28 14:18:44 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-10-10 16:16:01 +0100 |
commit | 5960c0556f1207a3bd9ca6dc7000210d7a307126 (patch) | |
tree | 6e75eb16d53881df69114b81c59fa0742df85826 /Userland/Games/Spider | |
parent | 12612703f9a80d75a72603982c47ba5966ca9efd (diff) | |
download | serenity-5960c0556f1207a3bd9ca6dc7000210d7a307126.zip |
LibCards+Games: Move `mark_intersecting_stacks_dirty()` to CardGame
As part of this, made a const overload for `Card::rect()`. We need the
non-const one too as it's used for modifying the position of a card
that's being dragged. I plan on changing that soon but we'll see.
Diffstat (limited to 'Userland/Games/Spider')
-rw-r--r-- | Userland/Games/Spider/Game.cpp | 10 | ||||
-rw-r--r-- | Userland/Games/Spider/Game.h | 1 |
2 files changed, 0 insertions, 11 deletions
diff --git a/Userland/Games/Spider/Game.cpp b/Userland/Games/Spider/Game.cpp index b525802bac..e8f5a91340 100644 --- a/Userland/Games/Spider/Game.cpp +++ b/Userland/Games/Spider/Game.cpp @@ -105,16 +105,6 @@ void Game::draw_cards() start_timer(s_timer_interval_ms); } -void Game::mark_intersecting_stacks_dirty(Card& intersecting_card) -{ - for (auto& stack : stacks()) { - if (intersecting_card.rect().intersects(stack.bounding_box())) - update(stack.bounding_box()); - } - - update(intersecting_card.rect()); -} - void Game::detect_full_stacks() { auto& completed_stack = stack_at_location(Completed); diff --git a/Userland/Games/Spider/Game.h b/Userland/Games/Spider/Game.h index ed7f26766e..9c3e870942 100644 --- a/Userland/Games/Spider/Game.h +++ b/Userland/Games/Spider/Game.h @@ -70,7 +70,6 @@ private: void start_timer_if_necessary(); void update_score(int delta); void draw_cards(); - void mark_intersecting_stacks_dirty(Card& intersecting_card); void detect_full_stacks(); void detect_victory(); void move_focused_cards(CardStack& stack); |