public abstract class FixedSetPrompt extends ValidatingPrompt
Modifier and Type | Field and Description |
---|---|
protected List<String> |
fixedSet |
END_OF_CONVERSATION
Constructor and Description |
---|
FixedSetPrompt(String... fixedSet)
Creates a FixedSetPrompt from a set of strings.
|
Modifier and Type | Method and Description |
---|---|
protected String |
formatFixedSet()
Utility function to create a formatted string containing all the
options declared in the constructor.
|
protected boolean |
isInputValid(ConversationContext context,
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(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, String input)
ValidatingPrompt
isInputValid
in class ValidatingPrompt
context
- Context information about the conversation.input
- The player's raw console input.protected String formatFixedSet()
Copyright © 2015. All rights reserved.