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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Substance.Solid
   * @augments adventurejs.Substance
   * @class adventurejs.Solid
   * @ajsconstruct MyGame.createAsset({ "class":"Solid", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading SubstanceClasses
   * @param {String} game_name Name of top level game instance that is scoped to window.
   * @param {String} name Instance name.
   * @summary Base class for Solid Substances, like dirt.
   * @tutorial Substances_AboutSubstances
   * @classdesc
   * <p>
   * <strong>Solid</strong> is a subclass of
   * {@link adventurejs.Substance|Substance} with solid
   * (as opposed to liquid or gaseous) properties.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <p>
   * Substances are different from
   * {@link adventurejs.Tangible|Tangibles} in that they're
   * semi-global, rather than singular. The class represents
   * all of its kind in a {@link adventurejs.Game|Game},
   * meaning, if you create an instance called "dirt", all
   * dirt in the Game is the same dirt, whether it's in a
   * grave or a bucket.
   * </p>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Solid",
   *   name: "dirt",
   *   description: "It's dirt. ",
   * });
   * MyGame.createAsset({
   *   class: "Bucket",
   *   name: "bucket",
   *   place: { in: "shed" },
   *   description: "It's a bucket. ",
   *   in:
   *   {
   *     vessel: {
   *       volume: 2000,
   *       substance_id: "dirt",
   *     },
   *   },
   * });
   * </code></pre>
   **/
  class Solid extends adventurejs.Substance {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Solid";
      
      this.noun = "Solid";

      this.setDOVs(["pour", "take", "put", "give"]);
      this.setIOVs(["fill"]);
      this.is.solid = true;

      //this.freezing_temperature = 0; // water // TODO lookup table
      //this.boiling_temperature = 100; // water // TODO lookup table
      this.specific_heat = 0.8; // soil = 0.8Kj or 800j // TODO lookup table
      this.state = this.game.settings.states.SOLID;
    }
  }

  adventurejs.Solid = Solid;
})();