diff --git a/RoloLudo.package/DeckOfCards.class/instance/draw..st b/RoloLudo.package/DeckOfCards.class/instance/draw..st index 22675f3..2b5b933 100644 --- a/RoloLudo.package/DeckOfCards.class/instance/draw..st +++ b/RoloLudo.package/DeckOfCards.class/instance/draw..st @@ -1,3 +1,6 @@ accessing -draw: aCollection - drawn := aCollection \ No newline at end of file +draw: card + self stock + detect: [ :each | each = card ] + ifFound: [self drawn add: card ] + ifNone: [ ^ nil ] \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/drawAll..st b/RoloLudo.package/DeckOfCards.class/instance/drawAll..st new file mode 100644 index 0000000..029c978 --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/drawAll..st @@ -0,0 +1,3 @@ +accessing +drawAll: aCollection + self drawn addAll: aCollection \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/drawn..st b/RoloLudo.package/DeckOfCards.class/instance/drawn..st new file mode 100644 index 0000000..de0e5ed --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/drawn..st @@ -0,0 +1,3 @@ +accessing +drawn: aCollection + drawn := aCollection \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/reset.st b/RoloLudo.package/DeckOfCards.class/instance/reset.st index 083bac2..4b96ab0 100644 --- a/RoloLudo.package/DeckOfCards.class/instance/reset.st +++ b/RoloLudo.package/DeckOfCards.class/instance/reset.st @@ -1,5 +1,5 @@ accessing reset - self draw: OrderedCollection new. + self drawn: OrderedCollection new. self cards: self class initialize cards. ^ self \ No newline at end of file