[Bleeding] Added Conversations API. Addresses BUKKIT-864

By: rmichela <deltahat@gmail.com>
This commit is contained in:
Bukkit/Spigot
2012-01-22 02:35:42 -05:00
parent fb55ed2a78
commit 2280c6be2b
26 changed files with 1446 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
package org.bukkit.conversations;
/**
* MessagePrompt is the base class for any prompt that only displays a message to the user and requires no input.
*/
public abstract class MessagePrompt implements Prompt{
public MessagePrompt() {
super();
}
/**
* Message prompts never wait for user input before continuing.
* @param context Context information about the conversation.
* @return
*/
public boolean blocksForInput(ConversationContext context) {
return false;
}
/**
* Accepts and ignores any user input, returning the next prompt in the prompt graph instead.
* @param context Context information about the conversation.
* @param input Ignored.
* @return The next prompt in the prompt graph.
*/
public Prompt acceptInput(ConversationContext context, String input) {
return getNextPrompt(context);
}
/**
* Override this method to return the next prompt in the prompt graph.
* @param context Context information about the conversation.
* @return The next prompt in the prompt graph.
*/
protected abstract Prompt getNextPrompt(ConversationContext context);
}