2017-06-30 14:47:51 +00:00
|
|
|
var BaseCache = require('./BaseCache');
|
|
|
|
var Class = require('../utils/Class');
|
|
|
|
|
|
|
|
// Phaser.Cache.GlobalCache
|
|
|
|
|
|
|
|
var GlobalCache = new Class({
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
function GlobalCache (game)
|
|
|
|
{
|
|
|
|
this.game = game;
|
|
|
|
|
|
|
|
this.binary = new BaseCache();
|
|
|
|
this.bitmapFont = new BaseCache();
|
2017-08-10 04:17:13 +00:00
|
|
|
this.json = new BaseCache();
|
|
|
|
this.physics = new BaseCache();
|
2017-06-30 14:47:51 +00:00
|
|
|
this.shader = new BaseCache();
|
2017-08-10 04:17:13 +00:00
|
|
|
this.sound = new BaseCache();
|
|
|
|
this.text = new BaseCache();
|
|
|
|
this.tilemap = new BaseCache();
|
|
|
|
this.video = new BaseCache();
|
|
|
|
this.xml = new BaseCache();
|
2017-06-30 14:47:51 +00:00
|
|
|
|
|
|
|
this.custom = {};
|
|
|
|
},
|
|
|
|
|
|
|
|
// Add your own custom Cache entry, available under Cache.custom.key
|
|
|
|
addCustom: function (key)
|
|
|
|
{
|
|
|
|
if (!this.custom.hasOwnProperty(key))
|
|
|
|
{
|
|
|
|
this.custom[key] = new BaseCache();
|
|
|
|
|
|
|
|
return this.custom[key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = GlobalCache;
|