public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, settings){
            var handler = this.performableActions[action];
            if(!handler){
                return false;
            }

            if(!handler.getTargetsForAction){
                return false;
            }

            settings = settings || {};
            if(!settings.skipCanPerformAction && !this.canPerformAction(action, settings)){
                return false;
            }

            return handler.getTargetsForAction.call(this, settings);
        }
function(action, settings){
            var handler = this.performableActions[action];
            if(!handler){
                return false;
            }

            if(!handler.getTargetsForAction){
                return false;
            }

            settings = settings || {};
            if(!settings.skipCanPerformAction && !this.canPerformAction(action, settings)){
                return false;
            }

            return handler.getTargetsForAction.call(this, settings);
        }
function ( action , settings ) { var handler = this . performableActions [ action ] ; if ( ! handler ) { return false ; } if ( ! handler . getTargetsForAction ) { return false ; } settings = settings || { } ; if ( ! settings . skipCanPerformAction && ! this . canPerformAction ( action , settings ) ) { return false ; } return handler . getTargetsForAction . call ( this , settings ) ; }
Returns a list of valid targets to perform an action on.
@method getTargetsForAction
@param {String} action - The action to get targets for.
@param {Object} [settings] - Settings for the action.
@return {Array} Array of valid targets.
Returns a list of valid targets to perform an action on .