diff --git a/RoloLudo.package/DeckOfCards.class/instance/cards..st b/RoloLudo.package/DeckOfCards.class/instance/cards..st new file mode 100644 index 0000000..64f0301 --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/cards..st @@ -0,0 +1,3 @@ +accessing +cards: aCollection + cards := aCollection \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/draw..st b/RoloLudo.package/DeckOfCards.class/instance/draw..st new file mode 100644 index 0000000..22675f3 --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/draw..st @@ -0,0 +1,3 @@ +accessing +draw: aCollection + drawn := aCollection \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/printOn..st b/RoloLudo.package/DeckOfCards.class/instance/printOn..st index df41ea2..b18908c 100644 --- a/RoloLudo.package/DeckOfCards.class/instance/printOn..st +++ b/RoloLudo.package/DeckOfCards.class/instance/printOn..st @@ -1,9 +1,12 @@ accessing printOn: aStream super initialize. + aStream nextPutAll: 'Stock: ', String cr. self class suits keysDo: [ :suit | aStream nextPutAll: (self stockCardsInSuit: suit); nextPutAll: String cr. ]. + aStream nextPutAll: 'Drawn: ', String cr. + self drawn do: [:card | aStream nextPutAll: card, ' ' ]. ^ aStream contents. \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/reset.st b/RoloLudo.package/DeckOfCards.class/instance/reset.st new file mode 100644 index 0000000..083bac2 --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/reset.st @@ -0,0 +1,5 @@ +accessing +reset + self draw: OrderedCollection new. + self cards: self class initialize cards. + ^ self \ No newline at end of file