Skip to content

Commit

Permalink
Solitaire: Remove redundant check and fix formatting mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlmrgvf authored and awesomekling committed Mar 11, 2020
1 parent 629036e commit 2af94bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Games/Solitaire/SolitaireWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ void SolitaireWidget::mousedown_event(GUI::MouseEvent& event)
for (auto& to_check : m_stacks) {
if (to_check.bounding_box().contains(click_location)) {
if (to_check.type() == CardStack::Type::Stock) {

auto& waste = stack(Waste);
auto& stock = stack(Stock);

Expand All @@ -200,8 +199,9 @@ void SolitaireWidget::mousedown_event(GUI::MouseEvent& event)
waste.set_dirty();
m_has_to_repaint = true;
update_score(-100);
} else
} else {
move_card(stock, waste);
}
} else if (!to_check.is_empty()) {
auto& top_card = to_check.peek();

Expand Down Expand Up @@ -238,8 +238,7 @@ void SolitaireWidget::mouseup_event(GUI::MouseEvent& event)
continue;

for (auto& focused_card : m_focused_cards) {
if (stack.bounding_box().intersects(focused_card.rect())
|| stack.bounding_box().contains(event.position())) {
if (stack.bounding_box().intersects(focused_card.rect())) {
if (stack.is_allowed_to_push(m_focused_cards.at(0))) {
for (auto& to_intersect : m_focused_cards) {
mark_intersecting_stacks_dirty(to_intersect);
Expand Down

0 comments on commit 2af94bb

Please sign in to comment.