summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/conversations/MessagePrompt.java
blob: 6d379bec10b1429dc53c4b75ff9fe4314b9c2e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 Always false.
     */
    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);
}