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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter
   * @augments adventurejs.Asset
   * @class adventurejs.Matter
   * @ajsconstruct MyGame.createAsset({ "class":"Matter", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading BaseClasses
   * @param {String} game_name Name of top level game instance that is scoped to window.
   * @param {String} name Instance name.
   * @summary Let's get physical! Physical!
   * @classdesc
   * <p>
   * <strong>Matter</strong> is a low-level subclass of
   * {@link adventurejs.Asset|Asset}, and the base class for
   * all physical matter in the
   * {@link adventurejs.Game|Game} world,
   * including
   * {@link adventurejs.Substance|Substances} and
   * {@link adventurejs.Tangible|Tangibles}. It exists chiefly
   * to provide a common base class for these two classes
   * for verb qualification with NounMustBe.matter.
   * </p>
   * <p>
   * Rather than subclassing Matter directly, authors should
   * use subclasses of Substance and Tangible.
   * </p>
   **/
  class Matter extends adventurejs.Asset {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Matter";

      // set up verbs that operate on all matter
      this.setDOVs(["examine", "look", "listen", "taste", "smell", "touch"]);
      this.setDOV({ hit: { with_anything: true, with_nothing: true } });
      this.setDOV({ flick: { with_nothing: true } });
    }

    validate(game) {
      super.validate(game);
      return true;
    }

    initialize(game) {
      super.initialize(game);
      return true;
    } // p.initialize

    destroy() {
      super.destroy();
      return true;
    } // p.destroy
  } // function Matter(id)

  adventurejs.Matter = Matter;
})();