Class: Klondike::MarkPlace
- Defined in:
- lib/rubysketch/solitaire/klondike.rb
Instance Attribute Summary
Attributes inherited from CardPlace
Instance Method Summary collapse
Methods inherited from CardPlace
#add, #id, #initialize, #inspect, #pop, #posFor, #sprite, #updateCards
Methods included from HasSprite
Constructor Details
This class inherits a constructor from CardPlace
Instance Method Details
#accept?(x, y, card) ⇒ Boolean
936 937 938 939 940 941 942 943 |
# File 'lib/rubysketch/solitaire/klondike.rb', line 936 def accept?(x, y, card) return false if !card || card.closed? || !card.canDrop? hit?(x, y) && card.last? && card.opened? && (!mark || mark == card.mark) && card.number == last&.number.then {|n| n ? n + 1 : 1} end |
#mark ⇒ Object
932 933 934 |
# File 'lib/rubysketch/solitaire/klondike.rb', line 932 def mark() last&.mark end |