Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0

Extends: adventurejs.Atom

Defined in: adventure/assets/tangibles/Nest.js, line 5

Description

Nest is a special class that adds the ability for Rooms and other Asset types Characters inside Aspects. The Nest stores a group of properties that determine how a character can interact with its container.

Private Constructor:

var foo = new adventurejs.Nest(game_name, name)

Parameters:

  • game_name String
    Name of top level game instance that is scoped to window.
  • name String
    Instance name.
Inherited Overrides

Index

Methods:

Properties:

Methods Collapse all  |  Expand all

getClassInheritance
getClassInheritance() → {Array}

Defined in: adventure/Atom.js, line 171

Inherited from: adventurejs.Atom#getClassInheritance

getClassInheritance is a utility method to get an asset's class inheritance chain. Returns a list of class names from high to low.

Returns:

Array
hasClass
hasClass(prop) → {Boolean}

Defined in: adventure/Atom.js, line 151

Inherited from: adventurejs.Atom#hasClass

Parameters:

  • prop String
    Name of the class to test for.
A method to test whether the Atom is an instance of a given class.

Returns:

Boolean
set
set(props) → {Object}

Defined in: adventure/Atom.js, line 139

Overrides from: adventurejs.Atom#set

Parameters:

  • props Object
    A generic object containing properties to copy to the Object instance.
Provides a chainable shortcut method for setting a number of properties on the instance.

Returns:

Object Returns the instance the method is called on (useful for chaining calls.)

Properties  | 

can.reach
can.reach :Array

Defined in: adventure/assets/tangibles/Nest.js, line 80

Default value: []

Nested property of Can

When player is nested within an aspect of an asset, other assets may not be reachable. reach enforces reachability of one asset from another. For example, if player is on a ladder, things on the ground might not be reachable. But, a player seated on a chair at a desk should be able to reach the desk and anything on it. Use this property to explicitly make some things reachable from other things. For example:

MyGame.createAsset({
  class: "Chair",
  name: "chair",
  descriptions: { look: "A office chair. " },
  aspects:
  {
    on: { nest: { can: { reach: [ 'desk' ] } } }
  }
});
game
game :Getter

Defined in: adventure/Atom.js, line 118

Inherited from: adventurejs.Atom#game

Returns the top level game object. Use this.game.
Name
Name :String

Defined in: adventure/Atom.js, line 62

Overrides from: adventurejs.Atom#Name

Class identifier to be provided in the asset definition. All game objects start as generic objects that get passed to createAsset, which uses an object's class field to specify a class constructor.