// moveThatFromThis.js
(function () {
/* global AdventureJS A */
var p = AdventureJS.Assets.Entity.prototype;
/**
* Removes an asset from another asset. It's not meant to be
* called directly, but is the last piece, or bedrock, of the
* removal process after checking for custom logic.
* @memberOf AdventureJS.Assets.Entity
* @method AdventureJS.Assets.Entity#moveThatFromThis
* @param {Object} asset
*/
p.moveThatFromThis = function Entity_moveThatFromThis(asset) {
if ("string" === typeof asset) asset = this.game.getAsset(asset);
if (!asset) return;
this.game.log(
"L1575",
"log",
"high",
`${this.id}.moveThatFromThis(${asset.name})`,
"Entity"
);
for (var aspect in this.aspects) {
if (this.aspects[aspect].contents?.includes(asset.id)) {
this.aspects[aspect].contents.splice(
this.aspects[aspect].contents.indexOf(asset.id),
1
);
}
}
return;
};
})();