Implementing storylet generators as generator functions
This commit is contained in:
@ -11,11 +11,11 @@ StoryManager.getAllStorylets = function(tag=null) {
|
||||
storylet = this.storylets[key];
|
||||
if (tag === null || ("tags" in storylet && storylet.tags.includes(tag))) {
|
||||
// TODO: If using yield, this part will change
|
||||
storylets = storylet.generate();
|
||||
for (let i in storylets) {
|
||||
boundStorylet = storylets[i];
|
||||
//storylets = storylet.generate();
|
||||
for (let boundStorylet of storylet.generate()) {
|
||||
//boundStorylet = storylets[i];
|
||||
if (!("priority" in boundStorylet)) boundStorylet.priority = 0;
|
||||
allStorylets.push(storylets[i]);
|
||||
allStorylets.push(boundStorylet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user