Collecting oracles from template wiki.
This commit is contained in:
parent
6815aa9158
commit
29a8d52f0f
@ -0,0 +1,18 @@
|
|||||||
|
accessing
|
||||||
|
loadOraclesFromWikiTemplate
|
||||||
|
| oraclesTiddler rows |
|
||||||
|
oraclesTiddler := self wiki templateWiki tiddlers
|
||||||
|
detect: [:tiddler | (tiddler title) = 'Tablas Generadoras' ].
|
||||||
|
rows := oraclesTiddler text lines allButFirst collect: [:each | each splitOn: '|'].
|
||||||
|
^ rows collect: [:row | | tempDice |
|
||||||
|
tempDice := (row second splitOn: '"') second.
|
||||||
|
tempDice := tempDice splitOn: Character space.
|
||||||
|
tempDice := { tempDice first asNumber . tempDice second asNumber }.
|
||||||
|
OrderedDictionary new
|
||||||
|
at: 'dice' put: tempDice;
|
||||||
|
at: 'region' put: row third;
|
||||||
|
at: 'theme' put: row fourth;
|
||||||
|
at: 'event' put: row fifth;
|
||||||
|
at: 'past' put: row sixth;
|
||||||
|
yourself.
|
||||||
|
]
|
3
RoloLudo.package/Firelights.class/instance/oracles..st
Normal file
3
RoloLudo.package/Firelights.class/instance/oracles..st
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
oracles: aDictionary
|
||||||
|
oracles := aDictionary
|
@ -1,3 +1,3 @@
|
|||||||
accessing
|
accessing
|
||||||
oracles
|
oracles
|
||||||
^ oracles ifNil: [ oracles := self populateOracles]
|
^ oracles ifNil: [ oracles := self loadOraclesFromWikiTemplate]
|
@ -1,6 +0,0 @@
|
|||||||
accessing
|
|
||||||
populateOracles
|
|
||||||
| oraclesTiddler |
|
|
||||||
oraclesTiddler := self wiki templateWiki tiddlers
|
|
||||||
detect: [:tiddler | (tiddler title) = 'Tablas Generadoras' ].
|
|
||||||
^ oraclesTiddler text lines allButFirst collect: [:each | each splitOn: '|']
|
|
Loading…
Reference in New Issue
Block a user