// setVesselAt.js
(function () {
/* global AdventureJS A */
var p = AdventureJS.Assets.Entity.prototype;
/**
* Add a substance container at the specified aspect on this asset.
* @memberOf AdventureJS.Assets.Entity
* @method AdventureJS.Assets.Entity#setVesselAt
* @param {string} aspect - The aspect to add.
* @return {Array}
*/
p.setVesselAt = function Entity_addVesselAt(aspect, params) {
if (!this.hasAspectAt(aspect)) {
this.setAspectAt(aspect, { context_id: this.id });
}
if (!this.hasVesselAtAspect(aspect)) {
if (!params) params = {};
this.aspects[aspect] = new AdventureJS.Helpers.Aspect(
aspect,
this.game_name,
this.id
).set(params);
} else {
if (params) this.getVesselAt(aspect).set(params);
}
return this.getVesselAt(aspect);
};
})();