// removeAssetAt.js
(function () {
/*global adventurejs A*/
"use strict";
var p = adventurejs.Tangible.prototype;
/**
* Remove specified asset id from the contents of
* specified aspect on this asset.
* Returns contents if aspect exists, or null.
* @memberOf adventurejs.Tangible
* @method adventurejs.Tangible#removeAssetAt
* @return {Array}
*/
p.removeAssetAt = function Tangible_removeAssetAt(id, aspect) {
if (this.hasAspectAt(aspect)) {
if (-1 < this.aspects[aspect].contents.indexOf(id)) {
this.aspects[aspect].contents.splice(
this.aspects[aspect].contents.indexOf(id),
1
);
}
return this.aspects[aspect].contents;
}
return null;
};
})();