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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Control.Switch
   * @augments adventurejs.Control
   * @class adventurejs.Switch
   * @ajsconstruct MyGame.createAsset({ "class":"Switch", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading ControlClasses
   * @param {String} game_name The name of the top level game object.
   * @param {String} name A name for the object, to be serialized and used as ID.
   * @summary Flip the switch.
   * @tutorial Tangibles_Controllers
   * @classdesc
   * <p>
   * <strong>Switch</strong> is a subclass of
   * {@link adventurejs.Control|Control} that can be
   * pressed, pushed, pulled, toggled, flicked, or flipped.
   * </p>
   * <pre class="display"><code class="language-javascript">
   * </code></pre>
   **/
  class Switch extends adventurejs.Control {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Switch";

      this.singlePluralPairs = [["switch ", "switches"]];

      this.setDOVs(["press", "push", "pull", "toggle", "flick", "flip"]);
    }
  }
  adventurejs.Switch = Switch;
})();