Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// disableCustomParser.js
(function() {
  /*global adventurejs A*/ 
  "use strict";

	var p = adventurejs.Parser.prototype;

  /**
   * Disable a custom parser(s) created by author.
   * @memberOf adventurejs.Parser
   * @method adventurejs.Parser#disableCustomParser
   * @param {String} parser The name of a previously created parser that has been stored at game.parser.custom_parsers[name].
   */
   p.disableCustomParser = function Parser_disableCustomParser( parser )
  {
    if( "function" !== typeof this.custom_parsers[ parser ] )
    {
      var msg = "disableCustomParser received invalid parser "
        + parser
        + ". ";
      console.warn( msg );
      return false;
    }
    this.custom_parsers_enabled[ parser ] = false;
    return this;
  }

}());