Changing API from NarrativeManager to StoryManager

This commit is contained in:
David Masad
2021-01-28 14:33:12 -05:00
parent 0413480900
commit 51dd88d89e
7 changed files with 30 additions and 30 deletions

View File

@ -6,10 +6,10 @@ var randomChoice = function(vals) {
// Set up the general narrative manager
// -----------------------------------------------------------------------
var NarrativeManager = {};
NarrativeManager.storylets = {};
var StoryManager = {};
StoryManager.storylets = {};
NarrativeManager.getAllStorylets = function() {
StoryManager.getAllStorylets = function() {
let allStorylets = [];
for (let key in this.storylets) {
let storylets = this.storylets[key].generate();
@ -18,7 +18,7 @@ NarrativeManager.getAllStorylets = function() {
return allStorylets;
}
NarrativeManager.getNStorylets = function(n) {
StoryManager.getNStorylets = function(n) {
/*
Get N storylets, prioritizing the highest-priority ones first.
For now assume that priorities are integers, but it would be nice
@ -42,4 +42,4 @@ NarrativeManager.getNStorylets = function(n) {
return selectedStorylets;
}
window.NM = NarrativeManager;
window.SM = StoryManager;