接口 Prompt

所有超级接口:
Cloneable
所有已知实现类:
BooleanPrompt, FixedSetPrompt, MessagePrompt, NumericPrompt, PlayerNamePrompt, RegexPrompt, StringPrompt, ValidatingPrompt

public interface Prompt extends Cloneable
Prompt 是 Conversation 的主要组成部分。每个提示向用户显示文本,并可选择等待用户的响应。 提示链接成一个有向图,表示对话流程。要停止对话,返回 END_OF_CONVERSATION 代替另一个 Prompt 对象。
  • 字段详细资料

    • END_OF_CONVERSATION

      static final Prompt 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 - 关于对话的上下文信息。
      返回:
      要显示的文本。
    • blocksForInput

      boolean blocksForInput(@NotNull @NotNull ConversationContext context)
      检查此提示实现是否应等待用户输入或立即显示下一个提示。

      原文: Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.

      参数:
      context - 关于对话的上下文信息。
      返回:
      如果为 true,Conversation 将在继续之前等待输入。如果为 false,acceptInput(ConversationContext, String) 将立即以 null 输入调用。
    • acceptInput

      接受并处理来自用户的输入。使用输入,返回提示图中的下一个 Prompt。

      原文: Accepts and processes input from the user. Using the input, the next Prompt in the prompt graph is returned.

      参数:
      context - 关于对话的上下文信息。
      input - 来自用户的输入文本。
      返回:
      提示图中的下一个 Prompt。