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

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

  class GraduatedController_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 = "GraduatedController_Is";
      this._on = false;
      return this;
    }

    /**
     * <code>on</code> indicates whether the object is turned on
     * via the turnOn verb. The GraduatedController class handles
     * on/off distinctly from other classes, because a GraduatedController
     * isn't required to be binary; it can be set to any number of
     * positions.
     * @var {Boolean} adventurejs.GraduatedController#is!on
     * @default false
     */

    get on() {
      return this.context.current_position === 0 ? false : true;
    }
    set on(value) {
      // can't be set
    }
  }
  adventurejs.GraduatedController_Is = GraduatedController_Is;
})();