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

	var p = adventurejs.Parser.prototype;

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

}());