Skip to content

Commit

Permalink
morphic/die morph: add accessors for #dieValue and #faces, recategori…
Browse files Browse the repository at this point in the history
…ze, fix indents
  • Loading branch information
LinqLover committed Sep 27, 2022
1 parent f9888cc commit bc25ddd
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 57 deletions.
20 changes: 10 additions & 10 deletions .squot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
OrderedDictionary {
'SmalltalkSources\/SBE-Environment.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Morphic.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-QuickTour.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Quinto.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Streams.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Testing.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Extract.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/BaselineOfSBE.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Monticello.package' : #SquotCypressCodeSerializer,
'SmalltalkSources\/SBE-Tests.package' : #SquotCypressCodeSerializer
'SmalltalkSources/SBE-Environment.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Morphic.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-QuickTour.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Quinto.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Streams.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Testing.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Extract.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/BaselineOfSBE.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Monticello.package' : #SquotCypressCodeSerializer,
'SmalltalkSources/SBE-Tests.package' : #SquotCypressCodeSerializer
}
1 change: 1 addition & 0 deletions SmalltalkSources/SBE-Morphic.package/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'd54694f920b5d7418b39e029092e1f4c' ],
#objectsReplacedByNames : true,
#serializer : #SquotCypressCodeSerializer
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
die logic
accessing
dieValue: aNumber

(aNumber isInteger and: [aNumber between: 1 and: faces]) ifTrue: [
dieValue := aNumber.
self changed].
self assert: (aNumber isInteger and: [aNumber between: 1 and: self faces]).
dieValue := aNumber.
self changed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
dieValue

^ dieValue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
drawing
drawDotOn: aCanvas at: aPoint

aCanvas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
drawing
drawOn: aCanvas

super drawOn: aCanvas.
(self perform: ('face' , dieValue) asSymbol)
drawing
drawOn: aCanvas

super drawOn: aCanvas.
(self perform: ('face' , self dieValue) asSymbol)
do: [:aPoint | self drawDotOn: aCanvas at: aPoint].
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face1

^ {0.5 @ 0.5}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face2

^ {0.25 @ 0.25 . 0.75 @ 0.75}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face3

^ {0.25 @ 0.25 . 0.75 @ 0.75 . 0.5 @ 0.5}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face4

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face5

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.5 @ 0.5}
^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.5 @ 0.5}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face6

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.25 @ 0.5 . 0.75 @ 0.5}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face7

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.25 @ 0.5 . 0.75 @ 0.5 . 0.5 @ 0.5}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face8

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.25 @ 0.5 . 0.75 @ 0.5 . 0.5 @ 0.5 . 0.5 @ 0.25}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
die logic
faces
face9

^ {0.25 @ 0.25 . 0.75 @ 0.25 . 0.75 @ 0.75 . 0.25 @ 0.75 . 0.25 @ 0.5 . 0.75 @ 0.5 . 0.5 @ 0.5 . 0.5 @ 0.25 . 0.5 @ 0.75}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
die logic
faces: aNumber
"Set the number of faces"

self assert: (aNumber isInteger and: [aNumber between: 1 and: 9]).
accessing
faces: aNumber
"Set the number of faces"

self assert: (aNumber isInteger and: [aNumber between: 1 and: 9]).
faces := aNumber.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
faces

^ faces
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
initialization
initialize

super initialize.
self
extent: 50 @ 50;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{
"class" : {
"faces:" : "on 8/16/2007 15:37" },
"instance" : {
"dieValue:" : "ct 9/26/2022 13:06",
"drawDotOn:at:" : "pre 12/2/2020 18:44",
"drawOn:" : "ct 9/26/2022 13:06",
"face1" : "pre 12/2/2020 18:44",
"face2" : "pre 12/2/2020 18:45",
"face3" : "pre 12/2/2020 18:45",
"face4" : "pre 12/2/2020 18:45",
"face5" : "pre 12/2/2020 18:45",
"face6" : "pre 12/2/2020 18:45",
"face7" : "pre 12/2/2020 18:46",
"face8" : "pre 12/2/2020 18:46",
"face9" : "pre 12/2/2020 18:46",
"faces:" : "pre 12/2/2020 18:46",
"handlesMouseDown:" : "pre 12/2/2020 18:46",
"initialize" : "pre 12/2/2020 18:52",
"mouseDown:" : "pre 12/2/2020 18:47",
"step" : "pre 12/2/2020 18:48",
"stepTime" : "pre 12/2/2020 18:48" } }
{
"class" : {
"faces:" : "on 8/16/2007 15:37" },
"instance" : {
"dieValue" : "ct 9/27/2022 08:33",
"dieValue:" : "ct 9/27/2022 08:34",
"drawDotOn:at:" : "pre 12/2/2020 18:44",
"drawOn:" : "ct 9/27/2022 08:34",
"face1" : "pre 12/2/2020 18:44",
"face2" : "pre 12/2/2020 18:45",
"face3" : "pre 12/2/2020 18:45",
"face4" : "pre 12/2/2020 18:45",
"face5" : "ct 9/27/2022 08:32",
"face6" : "pre 12/2/2020 18:45",
"face7" : "pre 12/2/2020 18:46",
"face8" : "pre 12/2/2020 18:46",
"face9" : "pre 12/2/2020 18:46",
"faces" : "ct 9/27/2022 08:33",
"faces:" : "ct 9/27/2022 08:33",
"handlesMouseDown:" : "pre 12/2/2020 18:46",
"initialize" : "ct 9/27/2022 08:32",
"mouseDown:" : "pre 12/2/2020 18:47",
"step" : "pre 12/2/2020 18:48",
"stepTime" : "pre 12/2/2020 18:48" } }

0 comments on commit bc25ddd

Please sign in to comment.