Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// Thing.js
(function () {
  /*global adventurejs A*/
  "use strict";
  /**
   * @augments adventurejs.Tangible
   * @class adventurejs.Thing
   * @ajsconstruct MyGame.createAsset({ "class":"Thing", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading BaseClasses
   * @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.
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing
   * @summary Base class for most things with physical properties.
   * @classdesc
   * <p>
   * <strong>Thing</strong> is a subclass of
   * {@link adventurejs.Tangible|Tangible}
   * and a base class for most all
   * {@link adventurejs.Asset|Assets}
   * with physical properties in the game world,
   * excluding a few Tangible subclasses such as
   * Characters, Rooms, and a few other special classes.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">
   * </code></pre>
   **/
  class Thing extends adventurejs.Tangible {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Thing";
      this.setDOVs(["take", "drop", "put", "throw"]);
    }

    initialize(game) {
      super.initialize(game);
      return this;
    }
  }
  adventurejs.Thing = Thing;
})();