java.lang.Cloneable
, Prompt
public abstract class FixedSetPrompt extends ValidatingPrompt
Modifier and Type | Field | Description |
---|---|---|
protected java.util.List<java.lang.String> |
fixedSet |
END_OF_CONVERSATION
Constructor | Description |
---|---|
FixedSetPrompt(java.lang.String... fixedSet) |
Creates a FixedSetPrompt from a set of strings.
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPromptText
acceptInput, acceptValidatedInput, blocksForInput, getFailedValidationText
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
in class ValidatingPrompt
context
- Context information about the conversation.input
- The player's raw console input.protected java.lang.String formatFixedSet()
Copyright © 2018. All rights reserved.