Sha256: 654863f67c9a11636d6abafe435815457803a75243a9401371d56ff44a3e0548

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

require_relative 'dealing_pile'
require_relative 'dealt_pile'
require_relative 'column_pile'
require_relative 'foundation_pile'

require_relative '../model/game'

class KlondikeSolitaire
  module View
    class Tableau
      include Glimmer::UI::CustomWidget
      
      option :game
      
      body {
        canvas {
          background :dark_green
          
          # row 1
          @foundation_piles = Model::PlayingCard::SUITS.each_with_index.map do |suit, i|
            foundation_pile(pile_x: MARGIN + i*(PLAYING_CARD_WIDTH + PLAYING_CARD_SPACING), pile_y: 0, game: game, suit: suit)
          end
          @dealt_pile = dealt_pile(pile_x: MARGIN + 5*(PLAYING_CARD_WIDTH + PLAYING_CARD_SPACING), pile_y: 0, model: game.dealt_pile)
          @dealing_pile = dealing_pile(pile_x: MARGIN + 6*(PLAYING_CARD_WIDTH + PLAYING_CARD_SPACING), pile_y: 0, model: game.dealing_pile)
          
          # row 2
          @column_piles = 7.times.map do |n|
            column_pile(pile_x: MARGIN + n*(PLAYING_CARD_WIDTH + PLAYING_CARD_SPACING), pile_y: PLAYING_CARD_HEIGHT + PLAYING_CARD_SPACING, model: game.column_piles[n])
          end
        }
      }
  
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
glimmer-dsl-swt-4.30.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.29.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.28.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.27.0.1 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.27.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.26.0.1 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.26.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.25.0.2 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.25.0.1 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.25.0.0 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.8 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.7 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.6 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.5 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.4 samples/elaborate/klondike_solitaire/view/tableau.rb
glimmer-dsl-swt-4.24.4.3 samples/elaborate/klondike_solitaire/view/tableau.rb