RoloLudo/RoloLudo.package/FirelightsGame.class/instance/loadOraclesFromWikiTemplate.st

18 lines
662 B
Smalltalk
Raw Normal View History

2023-11-29 16:24:01 +00:00
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.
]