接口 Prompt
- 所有超级接口:
Cloneable
- 所有已知实现类:
BooleanPrompt
,FixedSetPrompt
,MessagePrompt
,NumericPrompt
,PlayerNamePrompt
,RegexPrompt
,StringPrompt
,ValidatingPrompt
A Prompt is the main constituent of a
Conversation
. Each prompt
displays text to the user and optionally waits for a user's response.
Prompts are chained together into a directed graph that represents the
conversation flow. To halt a conversation, END_OF_CONVERSATION is returned
in liu of another Prompt object.-
字段概要
-
方法概要
修饰符和类型方法说明acceptInput
(ConversationContext context, String input) Accepts and processes input from the user.boolean
blocksForInput
(ConversationContext context) Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.getPromptText
(ConversationContext context) Gets the text to display to the user when this prompt is first presented.
-
字段详细资料
-
END_OF_CONVERSATION
A convenience constant for indicating the end of a conversation.
-
-
方法详细资料
-
getPromptText
Gets the text to display to the user when this prompt is first presented.- 参数:
context
- Context information about the conversation.- 返回:
- The text to display.
-
blocksForInput
Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.- 参数:
context
- Context information about the conversation.- 返回:
- If true, the
Conversation
will wait for input before continuing.
-
acceptInput
Accepts and processes input from the user. Using the input, the next Prompt in the prompt graph is returned.- 参数:
context
- Context information about the conversation.input
- The input text from the user.- 返回:
- The next Prompt in the prompt graph.
-