// setAspectAt.js
(function () {
/* global AdventureJS A */
var p = AdventureJS.Assets.Tangible.prototype;
/**
* Add an aspect at the specified aspect on this asset.
* @memberOf AdventureJS.Assets.Tangible
* @method AdventureJS.Assets.Tangible#setAspectAt
* @param {string} aspect - The aspect to add.
* @return {Array}
*/
p.setAspectAt = function Tangible_setAspectAt(aspect, params) {
if (this.hasAspectAt(aspect)) {
if (params) this.aspects[aspect].set(params);
} else {
if (!params) params = {};
this.aspects[aspect] = new AdventureJS.AssetHelpers.Aspect(
aspect,
this.game_name,
this.id
).set(params);
}
return this.getAspectAt(aspect);
};
})();