Class: Input
Defined in: adventure/Input.js, line 6
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 assumed 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:
- appendToOutput
- deletePhrase
- getAsset
- getAssumed
- getDictionaryVerb
- getDirection
- getExclusion
- getInPhrase
- getNoun
- getNounCount
- getParsedNoun
- getPhrase
- getPhraseCount
- getPreposition
- getStructure
- getStructure
- getVerb
- hasInput
- hasPhrase
- hasVerb
- overrideOutput
- prependToOutput
- pushParsedWord
- resetStructure
- setAsset
- setAssumed
- setDirection
- setDisambiguate
- setExclusion
- setInPhrase
- setNewPhrase
- setNoun
- setOneWord
- setParsedNoun
- setParsedNoun
- setPhrase
- setPreposition
- setSoftPrompt
- setStructure
- setVerb
- setVessel
- setVessel
- swapNouns
- swapPhrases
- swapPrepositions
Properties:
- allow_circular_verb
- disambiguate
- found_word
- game
- input
- input_verb
- joint
- 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
- unknown_word
- unparsed_input
- verb_chain
- verb_params
- verified_sentence
- verified_sentence_structure
Methods Collapse all |
appendToOutput(msg) → {boolean}
Defined in: adventure/Input.js, line 246
Parameters:
-
msg
String
Arbitrary string to append to next print.
Returns:
boolean
deletePhrase(index)
Defined in: adventure/Input.js, line 365
Parameters:
-
index
int
getAsset(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 499
Parameters:
-
index
int
Returns:
Object
|
Boolean
getAssumed(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 701
Parameters:
-
index
int
Returns:
Object
|
Boolean
getDictionaryVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 317
Parameters:
-
index
int
Returns:
Object
|
Boolean
getDirection(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 637
Parameters:
-
index
int
Returns:
Object
|
Boolean
getExclusion(index) → {String|Boolean}
Defined in: adventure/Input.js, line 476
Parameters:
-
index
int
Returns:
String
|
Boolean
getInPhrase(position, property) → {*}
Defined in: adventure/Input.js, line 781
Parameters:
-
position
String -
property
String
Returns:
*
getNoun(index) → {String|Boolean}
Defined in: adventure/Input.js, line 449
Parameters:
-
index
int
Returns:
String
|
Boolean
getNounCount() → {int}
getParsedNoun(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 659
Parameters:
-
index
int
Returns:
Object
|
Boolean
getPhrase(index) → {Object}
Defined in: adventure/Input.js, line 405
Parameters:
-
index
int
Returns:
Object
getPhraseCount()
Defined in: adventure/Input.js, line 601
getPreposition(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 615
Parameters:
-
index
int
Returns:
Object
|
Boolean
getStructure()
Defined in: adventure/Input.js, line 867
Todos: replace with verified sentence structure
getStructure(value) → {boolean}
Defined in: adventure/Input.js, line 887
Todos: replace with verified sentence structure
Parameters:
-
value
String
Returns:
boolean
getVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 301
Parameters:
-
index
int
Returns:
Object
|
Boolean
hasInput() → {Boolean}
Defined in: adventure/Input.js, line 814
Returns:
Boolean
hasPhrase(index) → {Boolean}
Defined in: adventure/Input.js, line 437
Parameters:
-
index
int
Returns:
Boolean
hasVerb(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 285
Parameters:
-
index
int
Returns:
Object
|
Boolean
overrideOutput(msg) → {boolean}
Defined in: adventure/Input.js, line 259
Parameters:
-
msg
String
Arbitrary string to override next print.
Returns:
boolean
prependToOutput(msg) → {boolean}
Defined in: adventure/Input.js, line 272
Parameters:
-
msg
String
Arbitrary string to prepend to next print.
Returns:
boolean
pushParsedWord(params)
Defined in: adventure/Input.js, line 899
Parameters:
-
params
Object
resetStructure()
Defined in: adventure/Input.js, line 386
setAsset(index, parsedNoun)
Defined in: adventure/Input.js, line 524
Parameters:
-
index
Int -
parsedNoun
Object
setAssumed(index) → {Object|Boolean}
Defined in: adventure/Input.js, line 712
Parameters:
-
index
int
Returns:
Object
|
Boolean
setDirection(index, value)
setDisambiguate(params)
Defined in: adventure/Input.js, line 853
Parameters:
-
params
Object
setExclusion(index, value) → {String|Boolean}
Defined in: adventure/Input.js, line 487
Parameters:
-
index
int -
value
String
Returns:
String
|
Boolean
setInPhrase(position, property) → {*}
Defined in: adventure/Input.js, line 799
Parameters:
-
position
String -
property
String
Returns:
*
setNewPhrase(params) → {Int}
Defined in: adventure/Input.js, line 572
Parameters:
-
params
Object
Returns:
Int
setNoun(index, value) → {String|Boolean}
Defined in: adventure/Input.js, line 460
Parameters:
-
index
int -
value
String
Returns:
String
|
Boolean
setOneWord(params)
Defined in: adventure/Input.js, line 838
Parameters:
-
params
Object
setParsedNoun(index, parsedNoun)
Defined in: adventure/Input.js, line 671
Parameters:
-
index
int -
parsedNoun
Object
setParsedNoun(index, parsedNoun)
Defined in: adventure/Input.js, line 683
Parameters:
-
index
int -
parsedNoun
Object
setPhrase(index, type, value)
Defined in: adventure/Input.js, line 350
Parameters:
-
index
int -
type
string -
value
string
setPreposition(index, value)
Defined in: adventure/Input.js, line 626
Parameters:
-
index
int -
value
string
setSoftPrompt(params)
setStructure()
Defined in: adventure/Input.js, line 877
Todos: replace with verified sentence structure
setVerb(value)
Defined in: adventure/Input.js, line 334
Parameters:
-
value
String
setVessel(index, asset)
Defined in: adventure/Input.js, line 543
Parameters:
-
index
Int -
asset
Object
setVessel(index, asset)
Defined in: adventure/Input.js, line 559
Parameters:
-
index
Int -
asset
Object
swapNouns(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 741
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
swapPhrases(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 724
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
swapPrepositions(index1, index2) → {Object|Boolean}
Defined in: adventure/Input.js, line 766
Parameters:
-
index1
int -
index2
int
Returns:
Object
|
Boolean
Properties |
allow_circular_verb :Boolean
Defined in: adventure/Input.js, line 176
Default value: false
Todos: Should this also be an Array and sync indexes with verb_chain?
disambiguate :int
Defined in: adventure/Input.js, line 152
Default value: { 'index':null, 'noun1':false, 'noun2':false, 'noun3':false }
found_word :String
Defined in: adventure/Input.js, line 109
Default value: ""
game :Getter
Defined in: adventure/Input.js, line 237
this.game
.
input :String
Defined in: adventure/Input.js, line 29
Default value: ""
input_verb :String
Defined in: adventure/Input.js, line 117
Default value: ""
joint :Array
Defined in: adventure/Input.js, line 210
Default value: []
output_class :String
Defined in: adventure/Input.js, line 101
Default value: ""
parsed_input :String
Defined in: adventure/Input.js, line 94
parsed_sentence :Array
Defined in: adventure/Input.js, line 52
Default value: []
parsed_word :Array
Defined in: adventure/Input.js, line 44
Default value: { 'enabled':false }
parsedNoun1 :Getter|Setter
Defined in: adventure/Input.js, line 944
parsedNoun1_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 977
parsedNoun2 :Getter|Setter
Defined in: adventure/Input.js, line 955
parsedNoun2_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 989
parsedNoun3 :Getter|Setter
Defined in: adventure/Input.js, line 966
parsedNoun3_is_assumed :Getter|Setter
Defined in: adventure/Input.js, line 1001
preposition1 :Getter|Setter
Defined in: adventure/Input.js, line 911
preposition2 :Getter|Setter
Defined in: adventure/Input.js, line 922
preposition3 :Getter|Setter
Defined in: adventure/Input.js, line 933
printer :Object
Defined in: adventure/Input.js, line 71
Default value: {append:[],prepend:[],override:[],appended:[],prepended:[],overridden:[]}
replacements :Object
Defined in: adventure/Input.js, line 194
Default value: {}
soft_prompt :Boolean
Defined in: adventure/Input.js, line 131
Default value: { 'verb':null, 'noun1':false, 'noun2':false, 'noun3':false, 'enabled':false, 'satisfied':false }
strings :Array
Defined in: adventure/Input.js, line 202
Default value: []
unknown_word :String
Defined in: adventure/Input.js, line 124
Default value: undefined
unparsed_input :String
Defined in: adventure/Input.js, line 87
Default value: ""
verb_chain :Array
Defined in: adventure/Input.js, line 167
Default value: []
verb_params :Object
Defined in: adventure/Input.js, line 185
Default value: {}
verified_sentence :Object
Defined in: adventure/Input.js, line 36
Default value: {}
verified_sentence_structure :Array
Defined in: adventure/Input.js, line 60
Default value: ""