Updating the storylet API

This commit is contained in:
David Masad
2021-01-27 18:02:34 -05:00
parent dc8d36b4de
commit 7a14ae671b
3 changed files with 55 additions and 46 deletions

View File

@ -6,11 +6,13 @@ var randomChoice = function(vals) {
// Set up the general narrative manager
// -----------------------------------------------------------------------
var NarrativeManager = {meta: []};
var NarrativeManager = {};
NarrativeManager.storylets = {};
NarrativeManager.getAllStorylets = function() {
let allStorylets = [];
for (let key in this.storyletMakers) {
let storylets = this.storyletMakers[key]();
for (let key in this.storylets) {
let storylets = this.storylets[key].generate();
for (let i in storylets) allStorylets.push(storylets[i]);
}
return allStorylets;