Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// getNestAspect.js
(function () {
  /*global adventurejs A*/
  "use strict";
  var p = adventurejs.Character.prototype;
  /**
   * Returns the aspect of this asset's parent
   * asset, or a blank string.
   * @memberOf adventurejs.Character
   * @method adventurejs.Character#getNestAspect
   * @return {Array}
   */
  p.getNestAspect = function Character_getNestAspect() {
    if (
      "undefined" === typeof this.nest ||
      Object.keys(this.nest).length === 0
    ) {
      return "";
    }
    let preposition = Object.keys(this.nest)[0];
    let asset = this.game.getAsset(this.nest[preposition]);
    return asset.aspects[preposition];
  };
})();