public/js-roguelike-skeleton/src/multi-object-manager.js
function MultiObjectManager(game, ObjectConstructor, width, height) {
        this.game = game;
        this.ObjectConstructor = ObjectConstructor;
        this.objects = [];
        this.map = new RL.Array2d();
        this.setSize(width, height);

        var map = this.map;
        this.map.each(function(val, x, y){
            map.set(x, y, []);
        });
    }
function MultiObjectManager(game, ObjectConstructor, width, height) {
        this.game = game;
        this.ObjectConstructor = ObjectConstructor;
        this.objects = [];
        this.map = new RL.Array2d();
        this.setSize(width, height);

        var map = this.map;
        this.map.each(function(val, x, y){
            map.set(x, y, []);
        });
    }
function MultiObjectManager ( game , ObjectConstructor , width , height ) { this . game = game ; this . ObjectConstructor = ObjectConstructor ; this . objects = [ ] ; this . map = new RL . Array2d ( ) ; this . setSize ( width , height ) ; var map = this . map ; this . map . each ( function ( val , x , y ) { map . set ( x , y , [ ] ) ; } ) ; }
Manages a list of object and their tile positions.
Multiple objects can be at a given tile map coord.
Handles adding, removing, moving objects within the game.
@class MultiObjectManager
@constructor
@param {Game} game - Game instance this `MultiObjectManager` is attached to.
@param {Object} ObjectConstructor - Object constructor used to create new objects with `this.add()`.
@param {Number} [width] - Width of current map in tiles.
@param {Number} [height] - Height of current map in tiles.
Manages a list of object and their tile positions . Multiple objects can be at a given tile map coord . Handles adding removing moving objects within the game .