// moveTo.js
(function () {
/* global adventurejs A */
var p = adventurejs.Tangible.prototype;
/**
* moveFrom is an alias to onMoveThatToThis
* but with asset and this reversed
* purely for syntactic convenience.
* @memberOf adventurejs.Tangible
* @method adventurejs.Tangible#moveTo
* @param {String} aspect
* @param {Object} asset
*/
p.moveTo = function Tangible_moveTo(aspect, asset) {
if ("string" === typeof asset) asset = this.game.getAsset(asset);
if (!asset) return false;
aspect = aspect || asset.default_aspect;
if (!aspect) return false;
if (!asset.hasAspectAt(aspect)) return false;
this.game.log(
"L1451",
"log",
"high",
`[moveTo.js] move ${this.id} ${aspect} ${asset.id} `,
"Tangible"
);
return asset.onMoveThatToThis(this, aspect);
};
})();