Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// replaceVerb.js

(function () {
  /*global adventurejs A*/
  "use strict";

  var p = adventurejs.Dictionary.prototype;

  /**
   *
   * @memberOf adventurejs.Dictionary
   * @method adventurejs.Dictionary#replaceVerb
   * @param {String} oldVerb
   * @param {Object} newVerb
   */
  p.replaceVerb = function (oldVerb, newVerb) {
    oldVerb = this.disableVerbs(oldVerb);
    newVerb = this.createVerb(newVerb);
    if (false !== newVerb) {
      this.game.log(
        "log",
        2,
        "replaceVerb successfully replaced verb " + newVerb.name + ".",
        "dictionary"
      );
    }
    return newVerb;
  };
})();