Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// isCurrentRoom.js

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

  var p = adventurejs.Game.prototype;

  /**
   * Tests whether the current room matches the provided name or id.
   * @method adventurejs.Game#isCurrentRoom
   * @memberOf adventurejs.Game
   * @returns {Object}
   */
  p.isCurrentRoom = function Game_isCurrentRoom(str) {
    const room = this.getAsset(this.world._room);
    return str === room.name || str === room.id;
  };
})();