/** * Passes player input into the current prompt. The next prompt (as * determined by the current prompt) is then displayed to the user. * * @param input The user's chat text. */ public void acceptInput(String input) { if (currentPrompt != null) { // Echo the user's input if (localEchoEnabled) { context.getForWhom().sendRawMessage(prefix.getPrefix(context) + input); } // Test for conversation abandonment based on input for(ConversationCanceller canceller : cancellers) { if (canceller.cancelBasedOnInput(context, input)) { abandon(new ConversationAbandonedEvent(this, canceller)); return; } } // Not abandoned, output the next prompt currentPrompt = currentPrompt.acceptInput(context, input); outputNextPrompt(); } }
@Override public boolean cancelBasedOnInput(ConversationContext context, String currentLine) { return canceller.cancelBasedOnInput(context, currentLine); }
if (canceller.cancelBasedOnInput(context, input)) { abandon(new ConversationAbandonedEvent(this, canceller)); return;