From dd23cd83d5bc016e1548c28813a01842f8ff0c1a Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 3 Dec 2023 15:32:32 -0500 Subject: [PATCH] Dice pool creation. --- RoloLudo.package/DicePool.class/instance/dice..st | 3 +++ RoloLudo.package/DicePool.class/instance/dice.st | 2 +- RoloLudo.package/DicePool.class/instance/with.with..st | 4 ++++ RoloLudo.package/Die.class/instance/printOn..st | 5 +++++ RoloLudo.package/Firelights.class/instance/dice.st | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 RoloLudo.package/DicePool.class/instance/dice..st create mode 100644 RoloLudo.package/DicePool.class/instance/with.with..st create mode 100644 RoloLudo.package/Die.class/instance/printOn..st diff --git a/RoloLudo.package/DicePool.class/instance/dice..st b/RoloLudo.package/DicePool.class/instance/dice..st new file mode 100644 index 0000000..7820d61 --- /dev/null +++ b/RoloLudo.package/DicePool.class/instance/dice..st @@ -0,0 +1,3 @@ +accessing +dice: anArray + dice := anArray \ No newline at end of file diff --git a/RoloLudo.package/DicePool.class/instance/dice.st b/RoloLudo.package/DicePool.class/instance/dice.st index c0c6028..e419c19 100644 --- a/RoloLudo.package/DicePool.class/instance/dice.st +++ b/RoloLudo.package/DicePool.class/instance/dice.st @@ -1,3 +1,3 @@ accessing dice - ^ dice ifNil: [dice := Array with: (Die with: 6) with: (Die with: 6) ] \ No newline at end of file + ^ dice ifNil: [dice := Array new ] \ No newline at end of file diff --git a/RoloLudo.package/DicePool.class/instance/with.with..st b/RoloLudo.package/DicePool.class/instance/with.with..st new file mode 100644 index 0000000..d8352bc --- /dev/null +++ b/RoloLudo.package/DicePool.class/instance/with.with..st @@ -0,0 +1,4 @@ +accessing +with: fistInteger with: secondInteger + + self dice: (Array with: (Die with: fistInteger) with: (Die with: secondInteger)) \ No newline at end of file diff --git a/RoloLudo.package/Die.class/instance/printOn..st b/RoloLudo.package/Die.class/instance/printOn..st new file mode 100644 index 0000000..93930fa --- /dev/null +++ b/RoloLudo.package/Die.class/instance/printOn..st @@ -0,0 +1,5 @@ +accessing +printOn: aStream + super initialize. + aStream + nextPutAll: self faces asString \ No newline at end of file diff --git a/RoloLudo.package/Firelights.class/instance/dice.st b/RoloLudo.package/Firelights.class/instance/dice.st index bdb0c25..a471038 100644 --- a/RoloLudo.package/Firelights.class/instance/dice.st +++ b/RoloLudo.package/Firelights.class/instance/dice.st @@ -1,3 +1,3 @@ accessing dice - ^ dice ifNil: [ dice := DicePool new ] \ No newline at end of file + ^ dice ifNil: [ dice := DicePool new with: 6 with: 6 ] \ No newline at end of file