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

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

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

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

            if(this.resolvableActions[action].init){
                this.resolvableActions[action].init.call(this);
            }
        }
function ( action , implementation ) { this . resolvableActions = this . resolvableActions || { } ; this . resolvableActions [ action ] = this . resolvableActions [ action ] || { } ; this . resolvableActions [ action ] . actionName = this . resolvableActions [ action ] . actionName || action ; implementation = implementation || RL . ResolvableAction . Types [ action ] ; this . resolvableActions [ action ] = Object . create ( implementation ) ; // merge could be used instead of Object.create but is less desirable // RL.Util.merge(this.resolvableAction.Types[action], implementation); if ( this . resolvableActions [ action ] . init ) { this . resolvableActions [ action ] . init . call ( this ) ; } }
Sets a resolvable action implementation on object.
@method setResolvableAction
@param {String} action - The action name.
@param {ResolvableAction} [implementation] - Object to set as the action implementation.
Sets a resolvable action implementation on object .