Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// Bowl.js
(function () {
  /*global adventurejs A*/
  "use strict";

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Container.LiquidContainer.Bowl
   * @augments adventurejs.LiquidContainer
   * @class adventurejs.Bowl
   * @ajsconstruct MyGame.createAsset({ "class":"Bowl", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading KitchenClasses
   * @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 Waiter, there's a fly in my soup!
   * @tutorial Tangibles_AboutTangibles
   * @classdesc <strong>Bowl</strong> is child class of
   * {@link adventurejs.Container|Container} /
   * {@link adventurejs.LiquidContainer|LiquidContainer}.
   * It can hold liquids (or other fluid substances),
   * be filled, emptied, poured from, drunk from.
   * See the example below to set
   * a container's volume, maxvolume, and substance.
   * See {@link adventurejs.LiquidContainer|LiquidContainer} for
   * more information about how substances are handled under the hood.
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Bowl",
   *   name: "dog dish",
   *   descriptions: { look: "That's Fido's water bowl! ", },
   *   in: {
   *     vessel: {
   *       volume: 500,
   *       maxvolume: 1000,
   *       substance_id: "water",
   *     }
   *   },
   * });
   * </code></pre>
   **/
  class Bowl extends adventurejs.LiquidContainer {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Bowl";

      this.noun = "bowl";
      this.plural = "bowls";
      this.singlePluralPairs = [["bowl", "bowls"]];

      this.setDOVs(["take", "give", "put"]);

      this.aspects.in.vessel.maxvolume = 500;
      this.aspects.in.vessel.can_overflow = true;
    }
  }
  adventurejs.Bowl = Bowl;
})();