Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// canNestPlayerAt.js

(function () {
  /* global AdventureJS A */

  var p = AdventureJS.Assets.Entity.prototype;

  /**
   * Ask if player can nest in an aspect of this asset.
   * @memberOf AdventureJS.Assets.Entity
   * @method AdventureJS.Assets.Entity#canNestPlayerAt
   * @param {String} aspect An Entity Aspect ID.
   * @returns {Boolean}
   */
  p.canNestPlayerAt = function Entity_canNestPlayerAt(aspect) {
    this.game.log(
      "L1463",
      "log",
      "high",
      `[canNestPlayerAt.js] ${aspect} ${this.name}?`,
      "Entity"
    );

    return (
      this.hasAspectAt(aspect) && this.aspects[aspect].canCharacter("enter")
    );
  };
})();