public/js-roguelike-skeleton/src/valid-targets-finder.js
function(x, y){
            var objects = this.game.getObjectsAtPostion(x, y);
            var range = RL.Util.getDistance(this.x, this.y, x, y);
            var _this = this;
            var filtered =  objects.filter(function(target){
                return _this.checkValidTarget(target);
            });

            return filtered.map(function(target){
                return _this.prepareTargetObject(target, x, y, range);
            });
        }
function(x, y){
            var objects = this.game.getObjectsAtPostion(x, y);
            var range = RL.Util.getDistance(this.x, this.y, x, y);
            var _this = this;
            var filtered =  objects.filter(function(target){
                return _this.checkValidTarget(target);
            });

            return filtered.map(function(target){
                return _this.prepareTargetObject(target, x, y, range);
            });
        }
function ( x , y ) { var objects = this . game . getObjectsAtPostion ( x , y ) ; var range = RL . Util . getDistance ( this . x , this . y , x , y ) ; var _this = this ; var filtered = objects . filter ( function ( target ) { return _this . checkValidTarget ( target ) ; } ) ; return filtered . map ( function ( target ) { return _this . prepareTargetObject ( target , x , y , range ) ; } ) ; }
Get valid target objects on a tile coord.
@method getValidTargetsAtPosition
@param {Number} x - Map tile coord to get valid target objects from.
@param {Number} y - Map tile coord to get valid target objects from.
@return {Array} mixed objects
Get valid target objects on a tile coord .