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

  /**
   * @ajspath adventurejs.Atom.StateManager.Aspect_Player
   * @augments adventurejs.StateManager
   * @class adventurejs.Aspect_Player
   * @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 properties pertaining to room/player interactions.
   * @classdesc
   * <p>
   * <strong>Aspect_Player</strong> is a state management class
   * for {@link adventurejs.Room|Rooms}
   * and {@link adventurejs.Aspect|Aspects}
   * used to store a variety of properties that determine
   * how a player can interact with a room or within an
   * aspect that the player is nested in.
   **/

  class Aspect_Player extends adventurejs.StateManager {
    constructor(name = "player", game_name, parent_id, preposition) {
      // Call the constructor of the parent class
      super(name, game_name, parent_id);

      this.class = "Aspect_Player";

      this.posture = "stand";
      this.preposition = preposition;
      this.initial_position = { x: 0, y: 0, z: 0 };
      this.can = {
        bounce: false /*locomotion*/,
        crawl: false /*locomotion*/,
        enter: false,
        exit: false,
        float: false /*locomotion*/,
        hear: false /* sensory */,
        hide: false,
        hop: false /*locomotion*/,
        hover: false /*locomotion*/,
        jump: false /*locomotion*/,
        kneel: false /* posture */,
        lie: false /* posture */,
        ride: false /*locomotion*/,
        run: false /*locomotion*/,
        see: false /* sensory */,
        sit: false /* posture */,
        slither: false /*locomotion*/,
        stand: false /* posture */,
        swim: false /*locomotion*/,
        walk: false /*locomotion*/,
      };

      return this;
    }
  }
  adventurejs.Aspect_Player = Aspect_Player;
})();