Class:Input
Defined in: adventure/Input.js, line 5
Description
Input is a special class constructed by Parser.parseInput(), and used to store each turn's input and all of the metadata that is generated for it, including the verb and noun(s) that were parsed, whether a disambiguation was called for, whether a soft prompt was made, whether a noun was inferred based upon context, and other data. This is an internal class that authors should not need to construct.
Private Constructor:
var foo = new adventurejs.Input()
- Index
- Methods
- Properties
Index
Methods:
- appendTurn
- deletePhrase
- getAdverb
- getAsset
- getContainerAsset
- getDictionaryVerb
- getDirection
- getExclusion
- getInferred
- getInPhrase
- getInput
- getNoun
- getNounCount
- getParam
- getParsedNoun
- getPhrase
- getPhraseCount
- getPreposition
- getStructure
- getStructure
- getSubject
- getSubject
- getSubstance
- getVerb
- hasInput
- hasPhrase
- hasVerb
- overrideTurn
- prependTurn
- pushParsedWord
- pushPhrase
- pushViewModifiers
- setAdverb
- setAsset
- setCharacter
- setContainer
- setContainer
- setDirection
- setDisambiguate
- setExclusion
- setInferred
- setInPhrase
- setNoun
- setOneWord
- setParam
- setParsedNoun
- setParsedNoun
- setPhrase
- setPreposition
- setSoftPrompt
- setStructure
- setVerb
- shiftPhrase
- swapNouns
- swapPhrases
- swapPrepositions
- updateStructure
Properties:
- allow_circular_verb
- did_do
- did_doSuccess
- did_try
- did_tryTravel
- disambiguate
- found_word
- game
- input
- input_verb
- output_class
- parsed_input
- parsed_sentence
- parsed_word
- parsedNoun1
- parsedNoun1_is_assumed
- parsedNoun2
- parsedNoun2_is_assumed
- parsedNoun3
- parsedNoun3_is_assumed
- preposition1
- preposition2
- preposition3
- printer
- replacements
- soft_prompt
- strings
- target
- unknown_word
- unparsed_input
- verb_chain
- verb_params
- verb_phrasal_pattern
- verb_phrase
- verb_phrase_prepositions
- verified_sentence
- verified_sentence_structure
- view_modifiers
Methods Collapse all |
appendTurn
appendTurn(msg) → {boolean}
Defined in: adventure/Input.js, line 319
appendTurn
Parameters:
-
msg
String
Arbitrary string to append to next print.
Returns:
boolean
deletePhrase
deletePhrase(index)
Defined in: adventure/Input.js, line 469
Parameters:
-
index
int
getAdverb
getAdverb() → {String}
Defined in: adventure/Input.js, line 425
Returns:
String
getAsset
getAsset(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 642
Parameters:
-
index
int
Returns:
Object
|
Boolean
getContainerAsset
getContainerAsset(index)
Defined in: adventure/Input.js, line 757
Parameters:
-
index
Int
getDictionaryVerb
getDictionaryVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 392
Parameters:
-
index
int
Returns:
Object
|
Boolean
getDirection
getDirection(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 869
Parameters:
-
index
int
Returns:
Object
|
Boolean
getExclusion
getExclusion(index) → {String|Boolean}
Defined in: adventure/Input.js, line 619
Parameters:
-
index
int
Returns:
String
|
Boolean
getInferred
getInferred(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 933
Parameters:
-
index
int
Returns:
Object
|
Boolean
getInPhrase
getInPhrase(position, property) → {*}
Defined in: adventure/Input.js, line 1014
Parameters:
-
position
String -
property
String
Returns:
*
getInput
getInput()
Defined in: adventure/Input.js, line 511
getNoun
getNoun(index) → {String|Boolean}
Defined in: adventure/Input.js, line 592
Parameters:
-
index
int
Returns:
String
|
Boolean
getNounCount
getNounCount() → {int}
getParam
getParam(param) → {*}
Defined in: adventure/Input.js, line 1189
Parameters:
-
param
String
Returns:
*
getParsedNoun
getParsedNoun(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 891
Parameters:
-
index
int
Returns:
Object
|
Boolean
getPhrase
getPhrase(index) → {Object}
Defined in: adventure/Input.js, line 548
Parameters:
-
index
int
Returns:
Object
getPhraseCount
getPhraseCount()
Defined in: adventure/Input.js, line 833
getPreposition
getPreposition(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 847
Parameters:
-
index
int
Returns:
Object
|
Boolean
getStructure
getStructure()
Defined in: adventure/Input.js, line 1102
Todos: replace with verified sentence structure
getStructure
getStructure(value) → {boolean}
Defined in: adventure/Input.js, line 1122
Todos: replace with verified sentence structure
Parameters:
-
value
String
Returns:
boolean
getSubject
getSubject() → {*}
Defined in: adventure/Input.js, line 1207
Returns:
*
getSubject
getSubject() → {*}
Defined in: adventure/Input.js, line 1220
Returns:
*
getSubstance
getSubstance(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 667
Parameters:
-
index
int
Returns:
Object
|
Boolean
getVerb
getVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 376
Parameters:
-
index
int
Returns:
Object
|
Boolean
hasInput
hasInput() → {Boolean}
Defined in: adventure/Input.js, line 1047
Returns:
Boolean
hasPhrase
hasPhrase(index) → {Boolean}
Defined in: adventure/Input.js, line 580
Parameters:
-
index
int
Returns:
Boolean
hasVerb
hasVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 360
Parameters:
-
index
int
Returns:
Object
|
Boolean
overrideTurn
overrideTurn(msg) → {boolean}
Defined in: adventure/Input.js, line 334
Parameters:
-
msg
String
Arbitrary string to override next print.
Returns:
boolean
prependTurn
prependTurn(msg) → {boolean}
Defined in: adventure/Input.js, line 347
Parameters:
-
msg
String
Arbitrary string to prepend to next print.
Returns:
boolean
pushParsedWord
pushParsedWord(params)
Defined in: adventure/Input.js, line 1134
Parameters:
-
params
Object
pushPhrase
pushPhrase(params) → {Int}
Defined in: adventure/Input.js, line 769
Parameters:
-
params
Object
Returns:
Int
pushViewModifiers
pushViewModifiers(identifier, asset, type)
Defined in: adventure/Input.js, line 1144
Parameters:
-
identifier
String
aka aspect or preposition or description -
asset
Object
can be null -
type
String
auto or input
setAdverb
setAdverb() → {String}
Defined in: adventure/Input.js, line 440
Returns:
String
setAsset
setAsset(index, parsedNoun)
Defined in: adventure/Input.js, line 686
Parameters:
-
index
Int -
parsedNoun
Object
setCharacter
setCharacter()
Defined in: adventure/Input.js, line 1233
setContainer
setContainer(index, asset)
Defined in: adventure/Input.js, line 716
Parameters:
-
index
Int -
asset
Object
setContainer
setContainer(index)
Defined in: adventure/Input.js, line 745
Parameters:
-
index
Int
setDirection
setDirection(index, value)
setDisambiguate
setDisambiguate(params)
Defined in: adventure/Input.js, line 1088
Parameters:
-
params
Object
setExclusion
setExclusion(index, value) → {String|Boolean}
Defined in: adventure/Input.js, line 630
Parameters:
-
index
int -
value
String
Returns:
String
|
Boolean
setInferred
setInferred(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 944
Parameters:
-
index
int
Returns:
Object
|
Boolean
setInPhrase
setInPhrase(position, property) → {*}
Defined in: adventure/Input.js, line 1032
Parameters:
-
position
String -
property
String
Returns:
*
setNoun
setNoun(index, value) → {String|Boolean}
Defined in: adventure/Input.js, line 603
Parameters:
-
index
int -
value
String
Returns:
String
|
Boolean
setOneWord
setOneWord(params)
Defined in: adventure/Input.js, line 1074
Parameters:
-
params
Object
setParam
setParam(param, value)
setParsedNoun
setParsedNoun(index, parsedNoun)
Defined in: adventure/Input.js, line 903
Parameters:
-
index
int -
parsedNoun
Object
setParsedNoun
setParsedNoun(index, parsedNoun)
Defined in: adventure/Input.js, line 915
Parameters:
-
index
int -
parsedNoun
Object
setPhrase
setPhrase(index, type, value)
Defined in: adventure/Input.js, line 454
Parameters:
-
index
int -
type
string -
value
string
setPreposition
setPreposition(index, value)
Defined in: adventure/Input.js, line 858
Parameters:
-
index
int -
value
string
setSoftPrompt
setSoftPrompt(params)
Defined in: adventure/Input.js, line 1058
Parameters:
-
params
Object
setStructure
setStructure()
Defined in: adventure/Input.js, line 1112
Todos: replace with verified sentence structure
setVerb
setVerb(value)
Defined in: adventure/Input.js, line 409
Parameters:
-
value
String
shiftPhrase
shiftPhrase(params) → {Int}
Defined in: adventure/Input.js, line 803
Parameters:
-
params
Object
Returns:
Int
swapNouns
swapNouns(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 974
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
swapPhrases
swapPhrases(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 956
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
swapPrepositions
swapPrepositions(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 999
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
updateStructure
updateStructure()
Defined in: adventure/Input.js, line 490
Properties |
allow_circular_verb
allow_circular_verb :Boolean
Defined in: adventure/Input.js, line 221
Default value: false
Todos: Should this also be an Array and sync indexes with verb_chain?
did_do
did_do :Boolean
Defined in: adventure/Input.js, line 303
Default value: false
did_doSuccess
did_doSuccess :Boolean
Defined in: adventure/Input.js, line 281
Default value: false
did_try
did_try :Boolean
Defined in: adventure/Input.js, line 297
Default value: false
did_tryTravel
did_tryTravel :Boolean
Defined in: adventure/Input.js, line 289
Default value: false
disambiguate
disambiguate :int
Defined in: adventure/Input.js, line 196
Default value: { 'index':null, 'noun1':false, 'noun2':false, 'noun3':false }
found_word
found_word :String
Defined in: adventure/Input.js, line 130
Default value: ""
game
game :Getter
Defined in: adventure/Input.js, line 310
this.game
.
input
input :String
Defined in: adventure/Input.js, line 42
Default value: ""
input_verb
input_verb :String
Defined in: adventure/Input.js, line 138
Default value: ""
output_class
output_class :String
Defined in: adventure/Input.js, line 122
Default value: ""
parsed_input
parsed_input :String
Defined in: adventure/Input.js, line 115
parsed_sentence
parsed_sentence :Array
Defined in: adventure/Input.js, line 73
Default value: []
parsed_word
parsed_word :Array
Defined in: adventure/Input.js, line 65
Default value: { 'enabled':false }
parsedNoun1
parsedNoun1 :Getter|Setter
Defined in: adventure/Input.js, line 1280
parsedNoun1_is_assumed
parsedNoun1_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 1313
parsedNoun2
parsedNoun2 :Getter|Setter
Defined in: adventure/Input.js, line 1291
parsedNoun2_is_assumed
parsedNoun2_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 1325
parsedNoun3
parsedNoun3 :Getter|Setter
Defined in: adventure/Input.js, line 1302
parsedNoun3_is_assumed
parsedNoun3_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 1337
preposition1
preposition1 :Getter|Setter
Defined in: adventure/Input.js, line 1247
preposition2
preposition2 :Getter|Setter
Defined in: adventure/Input.js, line 1258
preposition3
preposition3 :Getter|Setter
Defined in: adventure/Input.js, line 1269
printer
printer :Object
Defined in: adventure/Input.js, line 92
Default value: {append:[],prepend:[],override:[],appended:[],prepended:[],overridden:[]}
replacements
replacements :Object
Defined in: adventure/Input.js, line 239
Default value: {}
soft_prompt
soft_prompt :Boolean
Defined in: adventure/Input.js, line 170
Default value: { 'verb':null, 'noun1':false, 'noun2':false, 'noun3':false, 'enabled':false, 'satisfied':false }
strings
strings :Array
Defined in: adventure/Input.js, line 247
Default value: []
target
target :Object
Defined in: adventure/Input.js, line 33
Default value: {}
unknown_word
unknown_word :String
Defined in: adventure/Input.js, line 163
Default value: undefined
unparsed_input
unparsed_input :String
Defined in: adventure/Input.js, line 108
Default value: ""
verb_chain
verb_chain :Array
Defined in: adventure/Input.js, line 212
Default value: []
verb_params
verb_params :Object
Defined in: adventure/Input.js, line 230
Default value: {}
verb_phrasal_pattern
verb_phrasal_pattern :Array
Defined in: adventure/Input.js, line 255
Default value: []
verb_phrase
verb_phrase :String
Defined in: adventure/Input.js, line 147
Default value: ""
verb_phrase_prepositions
verb_phrase_prepositions :String
Defined in: adventure/Input.js, line 155
Default value: ""
verified_sentence
verified_sentence :Object
Defined in: adventure/Input.js, line 49
Default value: {}
verified_sentence_structure
verified_sentence_structure :Array
Defined in: adventure/Input.js, line 81
Default value: ""
view_modifiers
view_modifiers :Object
Defined in: adventure/Input.js, line 57
Default value: []