<commit_before>/* Storage Singleton */

/* The containers are injected from application.js to fix circular issues */

define(function(require, exports, module)
{
	var Backbone   = require("backbone"  );
	var Marionette = require("marionette");

	var Storage = Marionette.Controller.extend(
	{
		for: function(game)
		{
			this.users.parent     = game;
			this.tags.parent      = game;
			this.tabs.parent      = game;
			this.quests.parent    = game;
			this.media.parent     = game;
			this.web_hooks.parent = game;

			this.instances.parent = game;
			this.triggers.parent  = game;
			this.scenes.parent    = game;

			this.web_pages.parent = game;
			this.dialogs.parent   = game;
			this.plaques.parent   = game;
			this.items.parent     = game;
			this.factories.parent = game;

			this.dialog_scripts.parent = game;

			this.games.add(game);
		},

		// Add into proper storage
		add_game_object: function(game_object)
		{
			var idAttribute = game_object.idAttribute;

			     if(idAttribute === "dialog_id")   { this.dialogs.add(game_object)   }
			else if(idAttribute === "plaque_id")   { this.plaques.add(game_object)   }
			else if(idAttribute === "item_id")     { this.items.add(game_object)     }
			else if(idAttribute === "web_page_id") { this.web_pages.add(game_object) }
			else if(idAttribute === "scene_id")    { this.scenes.add(game_object)    }
			else if(idAttribute === "factory_id")  { this.factories.add(game_object) }
			else { throw "don't know where to store object of type " + game_object.idAttribute + ": " + game_object.id; }
		}
	});

	return new Storage();
});<commit_msg>Store instances and triggers<commit_after>/* Storage Singleton */

/* The containers are injected from application.js to fix circular issues */

define(function(require, exports, module)
{
	var Backbone   = require("backbone"  );
	var Marionette = require("marionette");

	var Storage = Marionette.Controller.extend(
	{
		for: function(game)
		{
			this.users.parent     = game;
			this.tags.parent      = game;
			this.tabs.parent      = game;
			this.quests.parent    = game;
			this.media.parent     = game;
			this.web_hooks.parent = game;

			this.instances.parent = game;
			this.triggers.parent  = game;
			this.scenes.parent    = game;

			this.web_pages.parent = game;
			this.dialogs.parent   = game;
			this.plaques.parent   = game;
			this.items.parent     = game;
			this.factories.parent = game;

			this.dialog_scripts.parent = game;

			this.games.add(game);
		},

		// Add into proper storage
		add_game_object: function(game_object)
		{
			var idAttribute = game_object.idAttribute;

			// These should call retrieve, just in case.
			     if(idAttribute === "dialog_id")   { this.dialogs.add(game_object)   }
			else if(idAttribute === "plaque_id")   { this.plaques.add(game_object)   }
			else if(idAttribute === "item_id")     { this.items.add(game_object)     }
			else if(idAttribute === "web_page_id") { this.web_pages.add(game_object) }
			else if(idAttribute === "scene_id")    { this.scenes.add(game_object)    }
			else if(idAttribute === "factory_id")  { this.factories.add(game_object) }

			else if(idAttribute === "instance_id") { this.instances.add(game_object) }
			else if(idAttribute === "trigger_id")  { this.triggers.add(game_object)  }

			else { throw "don't know where to store object of type " + game_object.idAttribute + ": " + game_object.id; }
		}
	});

	return new Storage();
});
{'fraction_non_alphanumeric': 0.13531641878098571, 'fraction_numerical': 0.0, 'mean_word_length': 3.213759213759214, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2085075', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1141, 'n_words': 228}