Sha256: 15fbd2022ea6c2c17dedf6a1984073dee39de52833c58aa35533d7d0786384fc
Contents?: true
Size: 865 Bytes
Versions: 16
Compression:
Stored size: 865 Bytes
Contents
require_relative '../model/dealing_pile' require_relative 'empty_playing_card' require_relative 'hidden_playing_card' class KlondikeSolitaire module View class DealingPile include Glimmer::UI::CustomShape options :pile_x, :pile_y, :model after_body { observe(model, 'playing_cards.empty?') do |empty_value| body_root.shapes.to_a.each { |shape| shape.dispose(redraw: false) } if empty_value body_root.content { empty_playing_card } else body_root.content { hidden_playing_card } end end } body { shape(pile_x, pile_y) { hidden_playing_card on_mouse_up do |event| model.deal! end } } end end end
Version data entries
16 entries across 16 versions & 1 rubygems