Class:Atom
Defined in: adventure/Atom.js, line 4
Description
Atom is a bedrock class that is used as the prime ancestor for all in-game classes. It defines several important base properties including name, class, id, and the set method. Authors should not need to instantiate or subclass Atom. Start with the Tangible class to create new physical Assets, or the Intangible class to create new abstract Assets.Private Constructor:
var foo = new adventurejs.Atom(game_name, name, context_id)
Parameters:
-
game_name
String
A reference back to the top level game object, by way of window[game_name]. Done this way rather than using an object reference in order to avoid circular references, because they're difficult to parse into JSON, the method that's used for saving/restoring game data. -
name
String
The name of the object in the game world, ie "brass lantern". The name is also used to create the object's id by means of removing periods and spaces and converting to lowercase. -
context_id
String
Optional param used by some supporting classes such as Aspects and Vessels to indicate context.
- Index
- Methods
- Properties
Index
Methods Collapse all |
getClassInheritance
getClassInheritance() → {Array}
Defined in: adventure/Atom.js, line 168
Returns:
Array
hasClass
hasClass(prop) → {Boolean}
Defined in: adventure/Atom.js, line 148
Parameters:
-
prop
String
Name of the class to test for.
Returns:
Boolean
set
set(props) → {Object}
Defined in: adventure/Atom.js, line 136
Parameters:
-
props
Object
A generic object containing properties to copy to the Object instance.
Returns:
Object
Returns the instance the method is called on (useful for chaining calls.)
set
set(props) → {Object}
Defined in: adventure/ParsedNoun.js, line 165
Parameters:
-
props
Object
A generic object containing properties to copy to the Object instance.
Returns:
Object
Returns the instance the method is called on (useful for chaining calls.)
Properties |
game
game :Getter
Defined in: adventure/Atom.js, line 115
this.game
.
Name
Name :String
Defined in: adventure/Atom.js, line 102
class
class :string
Defined in: adventure/Atom.js, line 60
context_id
context_id :string
Defined in: adventure/Atom.js, line 99
game_name
game_name :string
Defined in: adventure/Atom.js, line 48
id
id :string
Defined in: adventure/Atom.js, line 85
name
name :string
Defined in: adventure/Atom.js, line 74