lib/patience/event_handlers/click.rb
# Finds a card, which was clicked and tries to find
# descending cards, in the pile (if there are any).
Finds a card, which was clicked and tries to find
descending cards, in the pile (if there are any).
Finds a card which was clicked and tries to find descending cards in the pile ( if there are any ) .
def collect_cards
        card = detect_in(@areas, :card) { |card| card.hit?(@mouse_pos) }
        return card unless card
        n = @pile.size - @pile.cards.index(card)
        tail_cards = @pile.cards.last(n)
        Hash[*tail_cards.map { |card| [card, card.pos] }.flatten]
      end
def collect_cards card = detect_in ( @areas , :card ) { | card | card . hit? ( @mouse_pos ) } return card unless card n = @pile . size - @pile . cards . index ( card ) tail_cards = @pile . cards . last ( n ) Hash [ * tail_cards . map { | card | [ card , card . pos ] } . flatten ] end
Finds a card, which was clicked and tries to find
descending cards, in the pile (if there are any).
Finds a card which was clicked and tries to find descending cards in the pile ( if there are any ) .