Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// Basket.js
(function () {
  /* global AdventureJS A */

  /**
   * @ajstangiblecontainer in
   * @ajspath AdventureJS.Atom.Asset.Matter.Tangible.Thing.Container.SolidContainer.Basket
   * @augments AdventureJS.Assets.SolidContainer
   * @class AdventureJS.Assets.Basket
   * @ajsconstruct MyGame.createAsset({ "class":"Basket", "name":"foo", [...] })
   * @ajsconstructedby AdventureJS.Game#createAsset
   * @ajsnavheading ContainerClasses
   * @param {String} game_name The name of the top level game object.
   * @param {String} name A name for the object, to be serialized and used as ID.
   * @summary For carrying anything and everything.
   * @tutorial Tangibles_Aspects
   * @classdesc
   * <p>
   * <strong>Basket</strong> is a subclass of
   * {@link AdventureJS.Assets.SolidContainer|SolidContainer}.
   * It's possible to limit what can
   * be put in it by size, weight, and quantity.
   * It's also possible to restrict its contents to
   * certain classes or specific items.
   * </p>
   **/
  class Basket extends AdventureJS.Assets.SolidContainer {
    constructor(name, game_name, context_id = "", id = "") {
      super(name, game_name, context_id, id);
      this.class = "Basket";

      this.singularPluralPairs = [["basket", "baskets"]];

      this.aspects.in.set({
        contents_limits: {
          height: 1,
          width: 1,
          depth: 1,
          count: 10,
          weight: 10,
        },
        list_contents_in_examine: true,
        list_contents_in_room: true,
        nest: { can: { enter: false } },
      });
    }
  }

  AdventureJS.Assets.Basket = Basket;
})();