Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// exits.js
// OK 09 2023
/**
 *
 */
(function () {
  /* global AdventureJS A */

  /**
   * @augments {AdventureJS.Dictionary.Verb}
   * @class exits
   * @ajsnode game.dictionary.verbs.exits
   * @ajsconstruct MyGame.createVerb({ "name": "exits", [...] });
   * @ajsconstructedby AdventureJS.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading UtilityVerbs
   * @summary Verb that returns a list of available verbs.
   * @tutorial BasicVerbs_Subscriptions
   * @tutorial Reference_HowAVerbIsBuilt
   * @tutorial Reference_HowAVerbWorks
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @classdesc
   * <div class="display">
   * <div class="ajs-player-input">&gt; exits</div>
   * <div class="ajs-p">You can go out to the Playground, north to the North Room, down through the hole in the ground, south, east to the East Room, or west.
   * </div></div>
   * <p>
   * <strong>Exits</strong> prints a list of available Exits.
   * </p>
   */
  A.Dictionary.VerbDefinitions.exits = {
    name: "exits",
    synonyms: [],

    /**
     * @ajsverbstructures
     * @memberof exits
     */
    accepts_structures: ["verb"],

    do: function () {
      var input = this.game.getInput();
      var exits = this.game.getRoomExits();
      if (exits) {
        this.game.print(exits, input.output_class);
      }
      return true;
    },
  };
})();