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_nameString
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. -
nameString
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_idString
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 171
Returns:
Array
hasClass
hasClass(prop) → {Boolean}
Defined in: adventure/Atom.js, line 151
Parameters:
-
propString
Name of the class to test for.
Returns:
Boolean
set
set(props) → {Object}
Defined in: adventure/Atom.js, line 139
Parameters:
-
propsObject
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:
-
propsObject
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 118
this.game.
Name
Name :String
Defined in: adventure/Atom.js, line 62
Name
Name :String
Defined in: adventure/Atom.js, line 105
class
class :string
Defined in: adventure/Atom.js, line 60
context_id
context_id :string
Defined in: adventure/Atom.js, line 102
game_name
game_name :string
Defined in: adventure/Atom.js, line 48
id
id :string
Defined in: adventure/Atom.js, line 88