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

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

            if(!(handler.canPerformActionOnTarget === true || handler.canPerformActionOnTarget.call(this, target, settings))){
                return false;
            }
            return target.canResolveAction(action, this, settings);
        }
function(action, target, settings){
            if(!this.performableActions){
                return false;
            }
            var handler = this.performableActions[action];
            if(!handler){
                return false;
            }
            // target cannot resolve any actions
            if(!target.canResolveAction){
                return false;
            }

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

            if(!(handler.canPerformActionOnTarget === true || handler.canPerformActionOnTarget.call(this, target, settings))){
                return false;
            }
            return target.canResolveAction(action, this, settings);
        }
function ( action , target , settings ) { if ( ! this . performableActions ) { return false ; } var handler = this . performableActions [ action ] ; if ( ! handler ) { return false ; } // target cannot resolve any actions if ( ! target . canResolveAction ) { return false ; } settings = settings || { } ; if ( ! settings . skipCanPerformAction && ! this . canPerformAction ( action , settings ) ) { return false ; } if ( ! ( handler . canPerformActionOnTarget === true || handler . canPerformActionOnTarget . call ( this , target , settings ) ) ) { return false ; } return target . canResolveAction ( action , this , settings ) ; }
Checks if source can perform an action on target with given settings.
@method canPerformActionOnTarget
@param {string} action - The action to check.
@param {Object} target - The target object to check against.
@param {Object} [settings] - Settings for the action.
@param {Object} [settings.skipCanPerformAction] - If true skips checking that `this.canPerformAction(action, settings) == true`
@return {Boolean} `true` if the action can be performed on target.
Checks if source can perform an action on target with given settings .