diff --git a/RoloLudo.package/SfTruth.class/instance/asJson.st b/RoloLudo.package/SfTruth.class/instance/asJson.st new file mode 100644 index 0000000..4a7b6ac --- /dev/null +++ b/RoloLudo.package/SfTruth.class/instance/asJson.st @@ -0,0 +1,3 @@ +accessing +asJson + ^ STONJSON toStringPretty: (self asTiddlers collect: [:each | each asDictionary]) asArray \ No newline at end of file diff --git a/RoloLudo.package/SfTruth.class/instance/asTiddlers.st b/RoloLudo.package/SfTruth.class/instance/asTiddlers.st new file mode 100644 index 0000000..686447a --- /dev/null +++ b/RoloLudo.package/SfTruth.class/instance/asTiddlers.st @@ -0,0 +1,23 @@ +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 \ No newline at end of file diff --git a/RoloLudo.package/SfTruth.class/instance/character.st b/RoloLudo.package/SfTruth.class/instance/character.st new file mode 100644 index 0000000..0b27a66 --- /dev/null +++ b/RoloLudo.package/SfTruth.class/instance/character.st @@ -0,0 +1,3 @@ +accessing +character + ^ character \ No newline at end of file diff --git a/RoloLudo.package/SfTruthOption.class/instance/asWikiText.st b/RoloLudo.package/SfTruthOption.class/instance/asWikiText.st new file mode 100644 index 0000000..59b8a00 --- /dev/null +++ b/RoloLudo.package/SfTruthOption.class/instance/asWikiText.st @@ -0,0 +1,19 @@ +accessing +asWikiText + | stream | + stream := '' writeStream. + stream + nextPutAll: ''; + nextPutAll: self chance first asString, '-', self chance last asString; + nextPutAll: ' | ', self brief; + nextPutAll: ''; 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: ''. + ^ stream contents \ No newline at end of file diff --git a/RoloLudo.package/SfTruthOption.class/instance/details.st b/RoloLudo.package/SfTruthOption.class/instance/details.st new file mode 100644 index 0000000..55c4ca7 --- /dev/null +++ b/RoloLudo.package/SfTruthOption.class/instance/details.st @@ -0,0 +1,3 @@ +accessing +details + ^ details \ No newline at end of file diff --git a/RoloLudo.package/SfTruthOption.class/instance/questStarter.st b/RoloLudo.package/SfTruthOption.class/instance/questStarter.st new file mode 100644 index 0000000..b8f25eb --- /dev/null +++ b/RoloLudo.package/SfTruthOption.class/instance/questStarter.st @@ -0,0 +1,3 @@ +accessing +questStarter + ^ questStarter \ No newline at end of file diff --git a/RoloLudo.package/SfTruthOption.class/instance/subtableAsWikiText.st b/RoloLudo.package/SfTruthOption.class/instance/subtableAsWikiText.st new file mode 100644 index 0000000..9c89612 --- /dev/null +++ b/RoloLudo.package/SfTruthOption.class/instance/subtableAsWikiText.st @@ -0,0 +1,10 @@ +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 \ No newline at end of file