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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Doll
   * @augments adventurejs.Thing
   * @class adventurejs.Doll
   * @ajsconstruct MyGame.createAsset({ "class":"Doll", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading MiscAssetClasses
   * @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 Not the kind you wear, but the kind you attach to another thing.
   * @tutorial Tangibles_AboutTangibles
   * @classdesc
   * <p>
   * <strong>Doll</strong> is a subclass of
   * {@link adventurejs.Thing|Thing}
   * which can be attached to / detached from a parent.
   * {@link adventurejs.Asset|Assets}
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Doll",
   *   name: "Raggedy Ann",
   *   article: "",
   *   place: { on: "table" },
   *   descriptions: { look: "She's my dolly. ", },
   * });
   * </code></pre>
   **/
  class Doll extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Doll";

      this.singlePluralPairs = [["doll", "dolls"]];

      this.is.listed_in_parent = true;

      this.setDOVs([
        "put",
        "give",
        "take",
        "drop",
        "throw",
        "attach",
        "detach",
      ]);
      this.setIOVs(["attach", "detach"]);

      this.descriptions.look = "It's a doll.";
    }
  }

  adventurejs.Doll = Doll;
})();