lib/patience/event_handlers/click.rb
# Adds a card from Stock to Waste, if Stock was clicked.
Adds a card from Stock to Waste, if Stock was clicked.
Adds a card from Stock to Waste if Stock was clicked .
def stock
        if stock?
          if pile.empty?
            return if @areas[:waste].cards.size == 1
            pile.background = Ray::Sprite.new image_path('pile_background')
            refill_stock
          else
            displace_to_waste if @card
          end
          if pile.empty?
            if @areas[:waste].cards.size == 1
              pile.background = Ray::Sprite.new image_path('fully_empty_stock')
            else
              pile.background = Ray::Sprite.new image_path('empty_stock')
            end
          end
        end
      end
def stock if stock? if pile . empty? return if @areas [ :waste ] . cards . size == 1 pile . background = Ray :: Sprite . new image_path ( 'pile_background' ) refill_stock else displace_to_waste if @card end if pile . empty? if @areas [ :waste ] . cards . size == 1 pile . background = Ray :: Sprite . new image_path ( 'fully_empty_stock' ) else pile . background = Ray :: Sprite . new image_path ( 'empty_stock' ) end end end end
Adds a card from Stock to Waste, if Stock was clicked.
Adds a card from Stock to Waste if Stock was clicked .