Cloneable
BooleanPrompt
, FixedSetPrompt
, MessagePrompt
, NumericPrompt
, PlayerNamePrompt
, RegexPrompt
, StringPrompt
, ValidatingPrompt
public interface Prompt extends Cloneable
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.Modifier and Type | Field | Description |
---|---|---|
static Prompt |
END_OF_CONVERSATION |
A convenience constant for indicating the end of a conversation.
|
Modifier and Type | Method | Description |
---|---|---|
@Nullable Prompt |
acceptInput(@NotNull ConversationContext context,
@Nullable String input) |
Accepts and processes input from the user.
|
boolean |
blocksForInput(@NotNull ConversationContext context) |
Checks to see if this prompt implementation should wait for user input
or immediately display the next prompt.
|
@NotNull String |
getPromptText(@NotNull ConversationContext context) |
Gets the text to display to the user when this prompt is first
presented.
|
static final Prompt END_OF_CONVERSATION
@NotNull @NotNull String getPromptText(@NotNull @NotNull ConversationContext context)
context
- Context information about the conversation.boolean blocksForInput(@NotNull @NotNull ConversationContext context)
context
- Context information about the conversation.Conversation
will wait for input before
continuing. If false, acceptInput(ConversationContext, String)
will be called immediately with null
input.@Nullable @Nullable Prompt acceptInput(@NotNull @NotNull ConversationContext context, @Nullable @Nullable String input)
context
- Context information about the conversation.input
- The input text from the user.Copyright © 2020. All rights reserved.