forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobalCache.js
More file actions
41 lines (31 loc) · 949 Bytes
/
Copy pathGlobalCache.js
File metadata and controls
41 lines (31 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var BaseCache = require('./BaseCache');
var Class = require('../utils/Class');
// Phaser.Cache.GlobalCache
var GlobalCache = new Class({
initialize:
function GlobalCache (game)
{
this.game = game;
this.sound = new BaseCache();
this.video = new BaseCache();
this.text = new BaseCache();
this.json = new BaseCache();
this.xml = new BaseCache();
this.physics = new BaseCache();
this.tilemap = new BaseCache();
this.binary = new BaseCache();
this.bitmapFont = new BaseCache();
this.shader = new BaseCache();
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;