Recovering game reseting from last crash.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-11-28 12:07:32 -05:00
parent 7772524569
commit 014eba5937
4 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,6 @@
accessing
draw: aCollection
drawn := aCollection
draw: card
self stock
detect: [ :each | each = card ]
ifFound: [self drawn add: card ]
ifNone: [ ^ nil ]

View File

@ -0,0 +1,3 @@
accessing
drawAll: aCollection
self drawn addAll: aCollection

View File

@ -0,0 +1,3 @@
accessing
drawn: aCollection
drawn := aCollection

View File

@ -1,5 +1,5 @@
accessing
reset
self draw: OrderedCollection new.
self drawn: OrderedCollection new.
self cards: self class initialize cards.
^ self