Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// hasListableContents.js
(function () {
  /* global adventurejs A */
  var p = adventurejs.Tangible.prototype;
  /**
   * Check whether this asset has any listable contents.
   * @memberOf adventurejs.Tangible
   * @method adventurejs.Tangible#hasListableContents
   * @returns {Boolean}
   */
  p.hasListableContents = function Tangible_hasListableContents() {
    for (let item in this.aspects) {
      let aspect = this.aspects[item];
      if (aspect.list_contents_in_room && aspect.contents.length > 0) {
        if (
          aspect.name === "in" &&
          this.isDOV("open") &&
          this.is.closed &&
          this.appearance.opacity >= 1
        )
          continue;
        return true;
      }
    }

    return false;
  };
})();