Pre-release
AdventureJS Docs Downloads Bundler Devlog
Score: 0 Moves: 0
// getInput.js

(function () {
  /* global AdventureJS A */

  var p = AdventureJS.Game.prototype;

  /**
   * Convenience method to get this turn's input.
   * @method AdventureJS.Game#getInput
   * @memberOf AdventureJS.Game
   * @returns {Object}
   */
  p.getInput = p.input = function Game_getInput() {
    if (!this.parser) return null;
    if (!this.parser.input_history.length) {
      this.parser.initHistory();
    }
    return this.parser.input_history[0];
  };
})();