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

  /**
   * @ajspath adventurejs.Atom.StateManager.Asset_Is.Tangible_Is.SubstanceEmitter_Is
   * @augments adventurejs.Tangible_Is
   * @class adventurejs.SubstanceEmitter_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>SubstanceEmitter_Is.js</strong> handles is.state management for
   * {@link adventurejs.SubstanceEmitter|SubstanceEmitter Assets}.
   **/

  class SubstanceEmitter_Is extends adventurejs.Tangible_Is {
    constructor(name = "is", game_name, context_id) {
      // Call the constructor of the super class
      super(name, game_name, context_id);
      this.class = "SubstanceEmitter_Is";
      this._on = false;
      return this;
    }

    /**
     * <code>on</code> indicates whether the object is turned on
     * via the turnOn verb. The SubstanceEmitter class handles
     * on/off distinctly from other classes, because on/off is
     * determined by whether it is emitting.
     * Unavailable during asset construction, as context
     * won't have been defined yet.
     * @var {Boolean} adventurejs.SubstanceEmitter#is!on
     * @default false
     */
    get on() {
      return this.context.aspects.in.vessel.is.emitting;
    }
    set on(value) {
      // can't be set
    }

    /**
     * Shortcut to tangible.aspects.in.vessel.is.emitting.
     * Unavailable during asset construction, as context
     * won't have been defined yet.
     * @var {Getter/Setter} adventurejs.SubstanceEmitter#is!emitting
     */
    get emitting() {
      return this.context.aspects.in.vessel.is.emitting;
    }
    set emitting(value) {
      this.context.aspects.in.vessel.is.emitting = value;
    }
  }
  adventurejs.SubstanceEmitter_Is = SubstanceEmitter_Is;
})();