Testing changes in the repository.
This commit is contained in:
parent
9f8556bfa3
commit
ada2d9c5d2
@ -1,4 +0,0 @@
|
||||
accessing
|
||||
abilities: abilitiesDictionary
|
||||
"Keys are 'enabled' and 'disbled' and both contain arrays of text with abities."
|
||||
abilities := abilitiesDictionary
|
@ -1,6 +0,0 @@
|
||||
accessing
|
||||
abilities
|
||||
^ abilities ifNil: [ abilities := Dictionary new
|
||||
at: 'enabled' put: OrderedCollection new;
|
||||
at: 'disabled' put: OrderedCollection new;
|
||||
yourself ]
|
@ -1,10 +0,0 @@
|
||||
converting
|
||||
abilitiesAsWikiText
|
||||
| output |
|
||||
output := '' writeStream.
|
||||
output
|
||||
nextPutAll: '<ul style="list-style-type:none;">'; lf;
|
||||
nextPutAll: (self abilitiesAsWikiTextFor: self currentAbilities marked: '⬢');
|
||||
nextPutAll: (self abilitiesAsWikiTextFor: self pendingAbilities marked: '⬡');
|
||||
nextPutAll: '</ul>'.
|
||||
^ output contents
|
@ -1,12 +0,0 @@
|
||||
utilities
|
||||
abilitiesAsWikiTextFor: abilitiesSubset marked: unicodeSymbol
|
||||
|
||||
| aStream |
|
||||
aStream := '' writeStream.
|
||||
abilitiesSubset do: [:abi|
|
||||
aStream
|
||||
nextPutAll: ' <li> ', unicodeSymbol ; cr;
|
||||
nextPutAll: ' ';
|
||||
nextPutAll: abi; cr;
|
||||
nextPutAll: ' </li>'; cr ].
|
||||
^ aStream contents
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
asJsonTiddler
|
||||
^ self asTiddler asJson
|
@ -1,7 +0,0 @@
|
||||
converting
|
||||
asTiddler
|
||||
^ Tiddler new
|
||||
title: self name;
|
||||
tags: 'Starforged ' , self category;
|
||||
text: self abilitiesAsWikiText;
|
||||
created: DateAndTime now asString.
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
category: anObject
|
||||
category := anObject
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
category
|
||||
^ category
|
@ -1,3 +0,0 @@
|
||||
converting
|
||||
currentAbilities
|
||||
^ self abilities at: 'enabled'
|
@ -1,6 +0,0 @@
|
||||
accessing
|
||||
fromDictionary: aDictionary
|
||||
name := aDictionary at: #Name.
|
||||
category := aDictionary at: #Category.
|
||||
abilities := self populateAbilities: (aDictionary at: #Abilities)
|
||||
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
language: anObject
|
||||
language := anObject
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
language
|
||||
^ language
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name: anObject
|
||||
name := anObject
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name
|
||||
^ name
|
@ -1,3 +0,0 @@
|
||||
converting
|
||||
pendingAbilities
|
||||
^ self abilities at: 'disabled'
|
@ -1,10 +0,0 @@
|
||||
accessing
|
||||
populateAbilities: abilitiesDictionary
|
||||
|
||||
| enabled disabled |
|
||||
enabled := abilitiesDictionary select: [ :abi | abi keys includes: 'Enabled' ].
|
||||
disabled := abilitiesDictionary reject: [ :abi | abi keys includes: 'Enabled' ].
|
||||
^ self abilities
|
||||
at: 'enabled' put: (enabled collect: [:abi | (abi at: 'Text') ]);
|
||||
at: 'disabled' put: (disabled collect: [:abi | (abi at: 'Text') ]);
|
||||
yourself.
|
@ -1,6 +0,0 @@
|
||||
printing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: ' ( ' , self name , ' | ';
|
||||
nextPutAll: self category, ' )'
|
@ -1,4 +0,0 @@
|
||||
accessing
|
||||
translations: translationsDictory
|
||||
"Keys are ISO two letters language codes and values are the names of the asset in such language."
|
||||
translations := translationsDictory
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
translations
|
||||
^ translations
|
@ -1,8 +0,0 @@
|
||||
accessing
|
||||
fromUrlString: aString language: isoCode
|
||||
|
||||
| rawData |
|
||||
rawData := STON fromString: aString asUrl retrieveContents.
|
||||
self items: ((rawData at: 'Assets') collect: [:assetDict |
|
||||
SfAsset new fromDictionary: assetDict; language: isoCode ])
|
||||
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
items: anObject
|
||||
items := anObject
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
items
|
||||
^ items ifNil: [ items := OrderedCollection ]
|
@ -1,7 +0,0 @@
|
||||
accessing
|
||||
asTiddler
|
||||
^ Tiddler new
|
||||
title: self name;
|
||||
tags: 'Starforged ' ,'[[', self category,']]';
|
||||
text: self text;
|
||||
created: DateAndTime now asString.
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
category
|
||||
^ category
|
@ -1,8 +0,0 @@
|
||||
accessing
|
||||
fromDictionary: aDictionary
|
||||
| tempText |
|
||||
tempText := (WikiText new content: (aDictionary at: 'Text')) convertMarkdownBold; convertMarkdownLinks.
|
||||
category := aDictionary at: 'Category'.
|
||||
name := aDictionary at: 'Name'.
|
||||
text := tempText content.
|
||||
(aDictionary includesKey: 'Progress Move') ifTrue: [ self progress: true ]
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name
|
||||
^ name
|
@ -1,4 +0,0 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream nextPutAll: '( ', self name, ' ) '.
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
progress: aBoolean
|
||||
progress := aBoolean
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
progress
|
||||
^ progress
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
text
|
||||
^ text
|
@ -1,7 +0,0 @@
|
||||
accessing
|
||||
asTiddler
|
||||
^ Tiddler new
|
||||
title: self name;
|
||||
tags: 'Starforged';
|
||||
text: self intro, String lf, String lf, self optionsWikiTextTable;
|
||||
created: DateAndTime now asString.
|
@ -1,15 +0,0 @@
|
||||
accessing
|
||||
fromDictionary: aDictionary
|
||||
| optionsTable |
|
||||
name := aDictionary at: 'Name'.
|
||||
optionsTable := aDictionary at: 'Table'.
|
||||
optionsTable doWithIndex: [:opt :i | | key value prevKey |
|
||||
(i = 1)
|
||||
ifTrue: [key := 1 to: (opt at: 'Chance') asInteger]
|
||||
ifFalse: [
|
||||
prevKey := ((optionsTable at: (i-1)) at: 'Chance').
|
||||
key := (prevKey asInteger + 1) to: (opt at: 'Chance') asInteger.
|
||||
].
|
||||
value := (opt at: 'Description') capitalized.
|
||||
self options at: key put: value .
|
||||
].
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
intro: longerText
|
||||
intro := longerText
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
intro
|
||||
^ intro
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name: shortText
|
||||
name := shortText
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name
|
||||
^ name
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
options: anOrderedDictionary
|
||||
options := anOrderedDictionary
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
options
|
||||
^ options ifNil: [ options := OrderedDictionary new ]
|
@ -1,10 +0,0 @@
|
||||
accessing
|
||||
optionsWikiTextTable
|
||||
| output |
|
||||
output := '' writeStream.
|
||||
self options keysAndValuesDo: [:k :v |
|
||||
output
|
||||
nextPutAll: '| ', k first asString, ' - ', k last asString, ' |';
|
||||
nextPutAll: v, ' |'; cr
|
||||
].
|
||||
^ output contents
|
@ -1,5 +0,0 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: '( ', self name, ' )'.
|
@ -1,7 +0,0 @@
|
||||
accessing
|
||||
roll
|
||||
| diceRoll |
|
||||
diceRoll := 100 atRandom.
|
||||
self options keysAndValuesDo: [:k :v |
|
||||
(k includes: diceRoll) ifTrue: [ ^ v ]
|
||||
]
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
asJson
|
||||
^ STONJSON toStringPretty: (self asTiddlers collect: [:each | each asDictionary]) asArray
|
@ -1,23 +0,0 @@
|
||||
accessing
|
||||
asTiddlers
|
||||
| tiddlers transcluderText transcluder |
|
||||
tiddlers := OrderedCollection new.
|
||||
transcluderText := '' writeStream.
|
||||
self options doWithIndex: [:opt :i | | tiddler |
|
||||
tiddler := Tiddler new
|
||||
title: self name, 'Option', i asString;
|
||||
text: opt asWikiText;
|
||||
created: DateAndTime now asString.
|
||||
transcluderText nextPutAll: '{{', tiddler title, '}}'; cr; cr.
|
||||
tiddlers add: tiddler.
|
||||
].
|
||||
transcluderText
|
||||
nextPutAll: '----'; cr;
|
||||
nextPutAll: '👤 ', self character.
|
||||
transcluder := Tiddler new
|
||||
title: self name;
|
||||
tags: 'Starforged Truths';
|
||||
text: transcluderText contents;
|
||||
created: DateAndTime now asString.
|
||||
tiddlers add: transcluder.
|
||||
^ tiddlers
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
character: optionsPhrase
|
||||
character := optionsPhrase
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
character
|
||||
^ character
|
@ -1,6 +0,0 @@
|
||||
accessing
|
||||
fromDictionary: aDictionary
|
||||
name := aDictionary at: 'Name'.
|
||||
character := aDictionary at: 'Character'.
|
||||
(aDictionary at: 'Truths') collect: [:truth | self options add: ((SfTruthOption new fromDictionary: truth))].
|
||||
self refineOptionIntervals.
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name: aString
|
||||
name := aString
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
name
|
||||
^ name
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
options: anOrderedCollection
|
||||
options := anOrderedCollection
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
options
|
||||
^ options ifNil: [ options := OrderedCollection new ]
|
@ -1,5 +0,0 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: ' ( ', self name, ' ) '
|
@ -1,13 +0,0 @@
|
||||
accessing
|
||||
refineOptionIntervals
|
||||
| endings |
|
||||
endings := self options collect: [:opt | opt chance ].
|
||||
endings doWithIndex: [:end :i |
|
||||
|
||||
(i = 1)
|
||||
ifTrue: [(self options at: i) chance: (1 to: end)]
|
||||
ifFalse: [
|
||||
(self options at: i) chance: (((endings at: (i-1)) + 1) to: (endings at: i))
|
||||
]
|
||||
|
||||
].
|
@ -1,7 +0,0 @@
|
||||
accessing
|
||||
emptyTruth
|
||||
<gtExample>
|
||||
| testSfTruth |
|
||||
testSfTruth := SfTruth new.
|
||||
self assert: testSfTruth isEmpty.
|
||||
^ testSfTruth
|
@ -1,19 +0,0 @@
|
||||
accessing
|
||||
asWikiText
|
||||
| stream |
|
||||
stream := '' writeStream.
|
||||
stream
|
||||
nextPutAll: '<b>';
|
||||
nextPutAll: self chance first asString, '-', self chance last asString;
|
||||
nextPutAll: ' | ', self brief;
|
||||
nextPutAll: '</b>'; cr;
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: self details;
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: self subtableAsWikiText.
|
||||
stream
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: '<$details summary="Quest Starter">'; cr;
|
||||
nextPutAll: '//', self questStarter, '//'; cr;
|
||||
nextPutAll: '</$details>'.
|
||||
^ stream contents
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
brief: shortText
|
||||
brief := shortText
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
brief
|
||||
^ brief
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
chance: integerInterval
|
||||
chance := integerInterval
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
chance
|
||||
^ chance
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
details: longerText
|
||||
details := longerText
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
details
|
||||
^ details
|
@ -1,9 +0,0 @@
|
||||
accessing
|
||||
fromDictionary: aDictionary
|
||||
brief := aDictionary at: 'Description'.
|
||||
details := aDictionary at: 'Details'.
|
||||
questStarter := aDictionary at: 'Quest Starter'.
|
||||
subtable := aDictionary at: 'Table' ifAbsent: [ subtable := nil ].
|
||||
"Because of JSON original data this only puts the end of the chance interval.
|
||||
This needs to be refined at 'container' object SfTruth."
|
||||
chance := aDictionary at: 'Chance'
|
@ -1,6 +0,0 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: ' ( ', self brief, ' )'
|
||||
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
questStarter
|
||||
^ questStarter
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
subtable: aDictionary
|
||||
subtable := aDictionary
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
subtable
|
||||
^ subtable ifNil: [ subtable := OrderedDictionary new]
|
@ -1,10 +0,0 @@
|
||||
accessing
|
||||
subtableAsWikiText
|
||||
| stream chances |
|
||||
stream := '' writeStream.
|
||||
self subtable ifEmpty: [ ^ stream contents ].
|
||||
chances := self subtable collect: [ :each | each at: 'Chance' ].
|
||||
chances doWithIndex: [:ch :i |
|
||||
stream nextPutAll: '| ', ch asString, ' |', ((self subtable at: i) at: 'Description'), ' |' ; cr
|
||||
].
|
||||
^ stream contents
|
Loading…
Reference in New Issue
Block a user