Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// to.js
(function () {
  /* global adventurejs A */
  var p = adventurejs.Tangible.prototype;
  /**
   * <code>to</code> is an author shortcut that is similar
   * to moveTo but which bypasses onMoveThatToThis,
   * avoiding the consequences of any verb actions.
   * Accepts two forms of params:
   * cap.to( 'attached', 'pen' );
   * cap.to({ attached: 'pen' });
   * @memberOf adventurejs.Tangible
   * @method adventurejs.Tangible#to
   * @param {String|Object} a
   * @param {String} b
   */
  p.to = function Tangible_to(a, b) {
    let place, aspect, asset;
    if (typeof a === "object") {
      [[aspect, asset]] = Object.entries(a);
    } else {
      aspect = a;
      asset = b;
    }
    return this.setPlace(aspect, asset);
  };
})();