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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Candle
   * @augments adventurejs.Thing
   * @class adventurejs.Candle
   * @ajsconstruct MyGame.createAsset({ "class":"Candle", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading LightingClasses
   * @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 Asset class for a candle that can be lit and provide light.
   * @tutorial Tangibles_AboutTangibles
   * @classdesc
   * <p>
   * <strong>Candle</strong> is a subclass of
   * {@link adventurejs.Thing|Thing}.
   * {@link adventurejs.Asset|Assets}
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Candle",
   *   name: "occult candle",
   *   article: "an",
   *   place: { on: "table" },
   *   descriptions: { look: "It's an occult candle. ", },
   * });
   * </code></pre>
   * @TODO Light candle, extinguish candle, put candle in candle holder, provide light.
   */
  class Candle extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Candle";

      this.singlePluralPairs = [["candle", "candles"]];
      this.is.listed_in_parent = true;

      this.setDOVs(["shine", "take", "drop", "give", "throw"]);
      this.setIOV("look");

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

  adventurejs.Candle = Candle;
})();