public abstract class FixedSetPrompt extends ValidatingPrompt
限定符和类型 | 字段和说明 |
---|---|
protected java.util.List<java.lang.String> |
fixedSet |
END_OF_CONVERSATION
构造器和说明 |
---|
FixedSetPrompt(java.lang.String... fixedSet)
Creates a FixedSetPrompt from a set of strings.
|
限定符和类型 | 方法和说明 |
---|---|
protected java.lang.String |
formatFixedSet()
Utility function to create a formatted string containing all the
options declared in the constructor.
|
protected boolean |
isInputValid(ConversationContext context,
java.lang.String input)
Override this method to check the validity of the player's input.
|
acceptInput, acceptValidatedInput, blocksForInput, getFailedValidationText
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPromptText
public FixedSetPrompt(java.lang.String... fixedSet)
foo = new FixedSetPrompt("bar", "cheese", "panda");
fixedSet
- A fixed set of strings, one of which the user must
type.protected boolean isInputValid(ConversationContext context, java.lang.String input)
ValidatingPrompt
isInputValid
在类中 ValidatingPrompt
context
- Context information about the conversation.input
- The player's raw console input.protected java.lang.String formatFixedSet()