/overviewer_core/data/js_src/models.js
http://github.com/overviewer/Minecraft-Overviewer · JavaScript · 47 lines · 28 code · 9 blank · 10 comment · 0 complexity · 7c7f7171a5d249db0e137e7101a5f80d MD5 · raw file
- 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);
- }
- });