0
This repository has been archived on 2025-04-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Minecraft-Overviewer/overviewer_core/data/js_src/models.js
2012-02-08 21:07:53 -05:00

48 lines
1.1 KiB
JavaScript

overviewer.models = {};
/* WorldModel
* Primarily has a collection of TileSets
*/
overviewer.models.WorldModel = Backbone.Model.extend({
initialize: function(attrs) {
attrs.tileSets = new overviewer.models.TileSetCollection();
this.set(attrs);
}
});
/* WorldCollection
* A collection of WorldModels
*/
overviewer.models.WorldCollection = Backbone.Collection.extend({
model: overviewer.models.WorldModel
});
/* TileSetModel
*/
overviewer.models.TileSetModel = Backbone.Model.extend({
defaults: {
markers: [] ,
},
initialize: function(attrs) {
// this implies that the Worlds collection must be
// initialized before any TIleSetModels are created
attrs.world = overviewer.collections.worlds.get(attrs.world);
this.set(attrs);
},
});
overviewer.models.TileSetCollection = Backbone.Collection.extend({
model: overviewer.models.TileSetModel
});
overviewer.models.GoogleMapModel = Backbone.Model.extend({
initialize: function(attrs) {
attrs.currentWorldView = overviewer.collections.worldViews[0];
this.set(attrs);
},
});