public/js-roguelike-skeleton/src/multi-object-manager.js
function(x, y, settings){
            settings = settings || {};
            if(settings.filter){
                var filter = settings.filter;
                settings.filter = function(objects){
                    return objects.filter(filter);
                };
            }
            var results = this.map.getAdjacent(x, y, settings);
            var out = [];
            // merge all arrays
            return out.concat.apply(out, results);
        }
function(x, y, settings){
            settings = settings || {};
            if(settings.filter){
                var filter = settings.filter;
                settings.filter = function(objects){
                    return objects.filter(filter);
                };
            }
            var results = this.map.getAdjacent(x, y, settings);
            var out = [];
            // merge all arrays
            return out.concat.apply(out, results);
        }
function ( x , y , settings ) { settings = settings || { } ; if ( settings . filter ) { var filter = settings . filter ; settings . filter = function ( objects ) { return objects . filter ( filter ) ; } ; } var results = this . map . getAdjacent ( x , y , settings ) ; var out = [ ] ; // merge all arrays return out . concat . apply ( out , results ) ; }
Same as `this.map.getAdjacent`, but merges all results into on flat array.
@method getAdjacent
@param {Number} x - Map tile x coord.
@param {Number} y - Map tile y coord;
@param {Object} [settings]
@return {Array}
Same as this . map . getAdjacent but merges all results into on flat array .