public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, implementation){
            this.performableActions                     = this.performableActions                        || {};
            this.performableActions[action]             = this.performableActions[action]                || {};
            this.performableActions[action].actionName  = this.performableActions[action].actionName     || action;

            implementation = implementation || RL.PerformableAction.Types[action];

            this.performableActions[action] = Object.create(implementation);
            // merge could be used instead of Object.create but is less desirable
            // RL.Util.merge(this.performableAction.Types[action], implementation);

            if(this.performableActions[action].init){
                this.performableActions[action].init.call(this);
            }
        }
function(action, implementation){
            this.performableActions                     = this.performableActions                        || {};
            this.performableActions[action]             = this.performableActions[action]                || {};
            this.performableActions[action].actionName  = this.performableActions[action].actionName     || action;

            implementation = implementation || RL.PerformableAction.Types[action];

            this.performableActions[action] = Object.create(implementation);
            // merge could be used instead of Object.create but is less desirable
            // RL.Util.merge(this.performableAction.Types[action], implementation);

            if(this.performableActions[action].init){
                this.performableActions[action].init.call(this);
            }
        }
function ( action , implementation ) { this . performableActions = this . performableActions || { } ; this . performableActions [ action ] = this . performableActions [ action ] || { } ; this . performableActions [ action ] . actionName = this . performableActions [ action ] . actionName || action ; implementation = implementation || RL . PerformableAction . Types [ action ] ; this . performableActions [ action ] = Object . create ( implementation ) ; // merge could be used instead of Object.create but is less desirable // RL.Util.merge(this.performableAction.Types[action], implementation); if ( this . performableActions [ action ] . init ) { this . performableActions [ action ] . init . call ( this ) ; } }
Sets a performable action implementation on object.
@method setPerformableAction
@param {String} action - The action name.
@param {PerformableAction} implementation - Object to set as the action implementation.
or a string to lookup an implementation `RL.PerformableActions[implementation]`.
Sets a performable action implementation on object .