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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Branch
   * @augments adventurejs.Thing
   * @class adventurejs.Branch
   * @ajsconstruct MyGame.createAsset({ "class":"Branch", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading ForestClasses
   * @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 Carve it, burn it, whack with it.
   * @tutorial Tangibles_AboutTangibles
   * @classdesc
   * <p>
   * <strong>Branch</strong> is a subclass of
   * {@link adventurejs.Thing|Thing}
   * with no special properties.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Branch",
   *   name: "branch",
   *   place: { in: "forest" },
   *   descriptions: { look: "It's a branch. ", },
   * });
   * </code></pre>
   **/
  class Branch extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Branch";

      this.descriptions.look = "Branch.";
      this.singlePluralPairs = [["branch", "branches"]];

      // @TODO come back to this
      this.setDOVs(["give", "pull", "shake", "burn", "tie"]);

      this.on_tie_to_this_take_this = true;
      this.on_tie_to_drag_behind_rope = true;
    }
  }

  adventurejs.Branch = Branch;
})();