Class: Dictionary
Defined in: adventure/Dictionary.js, line 6
Dictionary manages all Verbs and Verb related functions. It also manages lookup tables for Verbs, nouns, directions, and sentence patterns. A Dictionary instance is created automatically by Game at runtime. There is no public constructor, and authors should not need to make new instances.
Private Constructor:
var foo = new adventurejs.Dictionary(game)
Parameters:
-
game
Game
A reference to the game instance.
Index
Methods:
- combineVerbs
- createVerb
- disableAllVerbsBut
- disableVerbs
- doVerb
- enableVerbs
- getAdjective
- getAdverb
- getDirection
- getPreposition
- getPronoun
- getStringLookup
- getStringLookupByRange
- initStandardVerbs
- isDirection
- isPreposition
- patchVerb
- replaceVerb
- set
- setStringLookup
- testVerbSynonyms
Properties:
- did_initialize_verbs
- directionLookup
- directions
- disabled_verbs
- enabled_verbs
- game
- if_input_is_empty_print_this
- if_parser_has_no_response_print_this
- preverbs
- pronouns
- string_lookup
- verb_lookup
- verb_noun_prep_noun_prep_nouns
- verb_noun_prep_nouns
- verb_noun_prep_prep_nouns
- verb_noun_preps
- verb_prep_noun_prep_noun_prep_nouns
- verb_prep_noun_prep_nouns
- verb_prep_nouns
- verb_prep_prep_nouns
- verb_prep_prep_prep_nouns
- verbs
Methods Collapse all |
Defined in: adventure/Dictionary.js, line 568
Parameters:
-
pushVerbs
String -
intoVerb
String
Defined in: adventure/Dictionary.js, line 485
Parameters:
-
preverb
object
A generic object.
Returns:
Verb
The constructed verb
Defined in: adventure/Dictionary.js, line 682
Parameters:
-
enabled_verbs
Array
Defined in: adventure/Dictionary.js, line 655
Parameters:
-
disabled_verbs
String | Array
Defined in: adventure/Dictionary.js, line 535
Parameters:
-
verb
String
Defined in: adventure/Dictionary.js, line 626
Parameters:
-
disabled_verbs
Array | String
Defined in: adventure/Dictionary.js, line 802
Parameters:
-
preposition
String
Returns:
String
|
Boolean
Defined in: adventure/Dictionary.js, line 788
Parameters:
-
preposition
String
Returns:
String
|
Boolean
Defined in: adventure/dictionary/getDirection.js, line 9
Parameters:
-
word
String
A direction name. Directions can have aliases, for example 'ne' as a shortcut for 'northeast'. When player inputs an alias, we want to lookup the primary name, which we need to get the direction object.
Returns:
String
The primary direction name.
Defined in: adventure/Dictionary.js, line 774
Parameters:
-
preposition
String
Returns:
String
|
Boolean
Defined in: adventure/dictionary/getPronoun.js, line 9
Parameters:
-
pronoun
String
Defined in: adventure/dictionary/string_lookup.js, line 143
Parameters:
-
type
string
The type to look up, ie "prepositions" or "posture_gerunds". -
value
string
The value to look up, ie "standing" or "0.1".
Returns:
string
Defined in: adventure/dictionary/string_lookup.js, line 262
Parameters:
-
type
string
The type to look up, ie "prepositions" or "posture_gerunds". -
value
string | number
The numerical value to look up, ie "70" or "0.1".
Returns:
string
Defined in: adventure/Dictionary.js, line 467
Defined in: adventure/dictionary/isDirection.js, line 9
Parameters:
-
word
String
A string to be evaluated.
Returns:
Boolean
Defined in: adventure/Dictionary.js, line 760
Parameters:
-
preposition
String
Returns:
Boolean
Defined in: adventure/Dictionary.js, line 711
Parameters:
-
patchVerb
Object
Defined in: adventure/Dictionary.js, line 550
Parameters:
-
oldVerb
String -
newVerb
Object
Defined in: adventure/dictionary/set.js, line 9
Parameters:
-
props
Object
A generic object containing properties to copy to the DisplayObject instance.
Returns:
adventurejs.Dictionary
Returns the instance the method is called on (useful for chaining calls.)
Defined in: adventure/dictionary/string_lookup.js, line 194
Parameters:
-
type
string
The type to set, ie "prepositions" or "posture_gerunds". -
values
object
An object containing values to set, ie {"standing":"standing up"} or {"0":"empty","1":"full"}.
Returns:
boolean
Defined in: adventure/dictionary/testVerbSynonyms.js, line 9
Parameters:
-
word1
String
An unclassed verb object.
Returns:
Verb
The constructed verb
Properties Collapse all |
Defined in: adventure/Dictionary.js, line 73
Default value: false
Defined in: adventure/Dictionary.js, line 40
Default value: {}
Defined in: adventure/Dictionary.js, line 32
Default value: {}
Todos: Is this irrelevant?
Defined in: adventure/Dictionary.js, line 65
Default value: []
Defined in: adventure/Dictionary.js, line 57
Default value: []
Defined in: adventure/Dictionary.js, line 25
Default value: {}
Defined in: adventure/Dictionary.js, line 89
Default value: "I didn't see any input."
Todos: Move to TBD StringManager where strings can be customized more easily.
Defined in: adventure/Dictionary.js, line 97
Default value: "I have no response to your input."
Todos: Move to TBD StringManager where strings can be customized more easily.
Defined in: adventure/Dictionary.js, line 423
Default value: []
Defined in: adventure/Dictionary.js, line 178
Defined in: adventure/dictionary/string_lookup.js, line 9
Default value: {}
Defined in: adventure/Dictionary.js, line 80
Default value: {}
Defined in: adventure/Dictionary.js, line 153
Default value: []
Defined in: adventure/Dictionary.js, line 137
Default value: []
Defined in: adventure/Dictionary.js, line 145
Default value: []
Defined in: adventure/Dictionary.js, line 105
Default value: []
Defined in: adventure/Dictionary.js, line 169
Default value: []
Defined in: adventure/Dictionary.js, line 161
Default value: []
Defined in: adventure/Dictionary.js, line 113
Default value: []
Defined in: adventure/Dictionary.js, line 121
Default value: []
Defined in: adventure/Dictionary.js, line 129
Default value: []
Defined in: adventure/Dictionary.js, line 48
Default value: {}