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

Defined in: adventure/Goalcard.js, line 5

Framework class

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:

  • game Game
    A reference to the game instance.
Inherited Overrides

Methods Collapse all  |  Expand all

activateGoal
activateGoal(key, recurse)

Defined in: adventure/Goalcard.js, line 36

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to activate recursively.
Activate a goal, with optional recurse.

Returns:

completeGoal
completeGoal(key, recurse)

Defined in: adventure/Goalcard.js, line 47

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to complete recursively.
Complete a goal, with optional recurse.

Returns:

countGoals
countGoals()

Defined in: adventure/Goalcard.js, line 69

Get a count of the number of goals in each group.
createGoal
createGoal() → {String}

Defined in: adventure/Goalcard.js, line 93

Create a new goal.

Returns:

String
deactivateGoal
deactivateGoal(key)

Defined in: adventure/Goalcard.js, line 112

Parameters:

  • key String
    A name or id to search for.
Deactivate a goal, with optional recurse.

Returns:

findGoalByKey
findGoalByKey(key, root) → {Object|null}

Defined in: adventure/Goalcard.js, line 133

Parameters:

  • key String
    An object key to search for.
  • root Object
    The root object level to begin search.
Find goal by key. Looks recursively.

Returns:

Object | null
processLonghand
processLonghand()

Defined in: adventure/Goalcard.js, line 229

Process goal data in longhand format.
processShorthand
processShorthand()

Defined in: adventure/Goalcard.js, line 262

Process goal data in shorthand format.
set
set(props) → {adventurejs.Goalcard}

Defined in: adventure/Goalcard.js, line 377

Parameters:

  • props Object
    A generic object containing properties to copy to the instance.
Provides a chainable shortcut method for setting a number of properties on 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:

  • key String
    A name or id to search for.
  • bool Boolean
    Activate or deactivate.
  • recurse Boolean
    Whether to activate recursively.
Toggle a goal's active state, with optional recurse.

Returns:

Properties  |