public/js-roguelike-skeleton/src/valid-targets-finder.js
function(target, x, y, range){
            x = x || target.x;
            y = y || target.y;
            range = range || RL.Util.getDistance(this.x, this.y, x, y);
            return {
                x: x,
                y: y,
                range: range,
                value: target
            };
        }
function(target, x, y, range){
            x = x || target.x;
            y = y || target.y;
            range = range || RL.Util.getDistance(this.x, this.y, x, y);
            return {
                x: x,
                y: y,
                range: range,
                value: target
            };
        }
function ( target , x , y , range ) { x = x || target . x ; y = y || target . y ; range = range || RL . Util . getDistance ( this . x , this . y , x , y ) ; return { x : x , y : y , range : range , value : target } ; }
Wraps a target object in a container object with x, y, range
@method prepareTargetObject
@param {Object} target
@param {Number} [x=target.x]
@param {Number} [y=target.y]
@param {Number} [range] range from `this.x`, `this.y` to x,y
@return {Object} result result object
`
return {
x: x, // target x tile coord
y: y, // target y tile coord
range: range, // distance to target
value: target // target object
};
`
@return {Object} result.x target x tile coord
@return {Object} result.y target y tile coord
@return {Object} result.range distance to target
@return {Object} result.value target object
Wraps a target object in a container object with x y range