Class:Goalcard
Defined in: adventure/Goalcard.js, line 5
Description
Goalcard is a repository for player goals. Goalcard is created automatically by Game. This is an internal class that authors should not need to construct. However, authors can set goal options from their game file as shown below.
Example:
var MyGame = new adventurejs.Game( "MyGame", "GameDisplay" );
MyGame.Goalcard.set({
});
Private Constructor:
var foo = new adventurejs.Goalcard(game)
Parameters:
-
gameGame
A reference to the game instance.
- Index
- Methods
- Properties
Methods Collapse all |
activateGoal
activateGoal(key, recurse)
Defined in: adventure/Goalcard.js, line 36
Parameters:
-
keyString
A name or id to search for. -
recurseBoolean
Whether to activate recursively.
Returns:
completeGoal
completeGoal(key, recurse)
Defined in: adventure/Goalcard.js, line 47
Parameters:
-
keyString
A name or id to search for. -
recurseBoolean
Whether to complete recursively.
Returns:
countGoals
countGoals()
Defined in: adventure/Goalcard.js, line 69
createGoal
createGoal() → {String}
deactivateGoal
deactivateGoal(key)
Defined in: adventure/Goalcard.js, line 112
Parameters:
-
keyString
A name or id to search for.
Returns:
findGoalByKey
findGoalByKey(key, root) → {Object|null}
Defined in: adventure/Goalcard.js, line 133
Parameters:
-
keyString
An object key to search for. -
rootObject
The root object level to begin search.
Returns:
Object
|
null
processLonghand
processLonghand()
Defined in: adventure/Goalcard.js, line 229
processShorthand
processShorthand()
Defined in: adventure/Goalcard.js, line 262
set
set(props) → {adventurejs.Goalcard}
Defined in: adventure/Goalcard.js, line 377
Parameters:
-
propsObject
A generic object containing properties to copy to the instance.
Returns:
adventurejs.Goalcard
Returns the instance the method is called on (useful for chaining calls.)
toggleGoal
toggleGoal(key, bool, recurse)
Defined in: adventure/Goalcard.js, line 445
Parameters:
-
keyString
A name or id to search for. -
boolBoolean
Activate or deactivate. -
recurseBoolean
Whether to activate recursively.