Class: GlimmerKlondikeSolitaire::View::ColumnPile

Inherits:
Object
  • Object
show all
Includes:
Glimmer::UI::CustomShape
Defined in:
app/glimmer_klondike_solitaire/view/column_pile.rb

Instance Method Summary collapse

Instance Method Details

#build_column_pile(playing_cards) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'app/glimmer_klondike_solitaire/view/column_pile.rb', line 43

def build_column_pile(playing_cards)
  body_root.shapes.to_a.dup.each {|shape| shape.dispose(dispose_images: false)}
  current_parent = body_root
  playing_cards.each_with_index do |card, i|
    current_parent.content {
      current_parent = playing_card(card_x: 0, card_y: PLAYING_CARD_COLUMN_SPACING, model: card, parent_pile: self) {
        drag_source true unless card.hidden?
      }.body_root
    }
  end
end