Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// Substance_Is.js
(function () {
  /*global adventurejs A*/

  /**
   * @ajspath adventurejs.Atom.StateManager.Asset_Is.Substance_Is
   * @augments adventurejs.Asset_Is
   * @class adventurejs.Substance_Is
   * @ajsnavheading StateClasses
   * @param {String} game_name Name of top level game instance that is scoped to window.
   * @param {String} name Instance name.
   * @summary A container for state variables.
   * @classdesc
   * <p>
   * <strong>Substance_Is.js</strong> handles is.state management for
   * @TODO change is.substancetype to single constant?
   * {@link adventurejs.Substance|Substance Assets}.
   **/

  class Substance_Is extends adventurejs.Asset_Is {
    constructor(name = "is", game_name, context_id) {
      // Call the constructor of the super class
      super(name, game_name, context_id);

      this.class = "Substance_Is";

      /**
       * Set whether this asset is liquid.
       * @var {Boolean} adventurejs.Substance#is!liquid
       * @default false
       */
      this.liquid = false;

      /**
       * Set whether this asset is gas.
       * @var {Boolean} adventurejs.Substance#is!liquid
       * @default false
       */
      this.gas = false;

      /**
       * Set whether this asset is solid.
       * @var {Boolean} adventurejs.Substance#is!liquid
       * @default false
       */
      this.solid = false;

      /**
       * Set whether this asset is slurry.
       * @var {Boolean} adventurejs.Substance#is!liquid
       * @default false
       */
      this.slurry = false;

      /**
       * Set this asset known. All substances are known by default.
       * @var {Boolean} adventurejs.Substance#is!known
       * @default true
       */
      this.known = true; // ok

      /**
       * Set this asset seen. All substances are seen by default.
       * @var {Boolean} adventurejs.Substance#is!seen
       * @default true
       */
      this.is_seen = true; // ok

      // @TODO
      // this.global = true; // should substances be global?
      // this.singleton = true; // should substances be singleton?
    }

    /**
     * Substances are always known by default.
     */
    get known() {
      return this._known;
    }

    set known(known) {
      this._known = known;
    }

    /**
     * Substances are always seen by default.
     */
    get seen() {
      return this._seen;
    }

    set seen(seen) {
      this._seen = seen;
    }
  }
  adventurejs.Substance_Is = Substance_Is;
})();